Detect URL Scheme • Rust AI Agent SDK

detect_url_scheme: Detect URL scheme from a string. O(1) operation.

detect_url_scheme

Function

</div>

This function is defined in the parse_utils module.

Detect URL scheme from a string. O(1) operation.

Signature

python
def detect_url_scheme(value: &str) -> Option<String>

Parameters

ParamField &str

No description available.

Returns

python
use praisonai::parity::parse_utils::detect_url_scheme;

assert_eq!(detect_url_scheme("postgresql://localhost/db"), Some("postgresql".to_string()));
assert_eq!(detect_url_scheme("redis://localhost:6379"), Some("redis".to_string()));
assert_eq!(detect_url_scheme("not a url"), None);

Uses

  • contains
  • find
  • chars
  • all
  • is_alphanumeric
  • to_lowercase

Source

View on GitHub

praisonai/src/parity/parse_utils.rs at line 26