[][src]Function rfc2396::validate_opt

pub fn validate_opt<'a, S>(uri: S) -> Option<&'a str> where
    S: Into<&'a str>, 

Validate the given URI against RFC2396, returning an Option<&str> indicating its validity.

Entire input consumption is also checked as part of validation. The embedded &str is the input.

Examples

let valid_uri = rfc2396::validate_opt("https://example.com");
assert_eq!(valid_uri, Some("https://example.com"));