[][src]Function rfc2396::validate_res

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

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

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

Examples

let validation = rfc2396::validate_res("https://example.com");
assert_eq!(type_of(&validation), std::any::type_name::<anyhow::Result<&str>>());
assert_eq!(validation?, "https://example.com");

Errors

If validation fails, a default nom::IResult converted into an anyhow::Result with additional context added by anyhow will be returned.