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
def detect_url_scheme(value: &str) -> Option<String>Parameters
ParamField
&strNo description available.
Returns
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
containsfindcharsallis_alphanumericto_lowercase
Source
View on GitHubpraisonai/src/parity/parse_utils.rs at line 26