Expand description
To use this crate, simply call one of the validate* functions, depending on your use case and desired return type:
validate(S) -> boolvalidate_nom(S) -> nom::IResult<&str, &str>validate_opt(S) -> Option<&str>validate_res(S) -> anyhow::Result<&str>
Where S is some type that implements Into<&str>; for example, &str itself!
All functions except the _nom variant will additionally ensure that the entire input is consumed and
matches exactly what was parsed internally. If you require that this check is not done (e.g. as part of a larger
parsing exercise), then use the _nom variant.
Functionsยง
- validate
- Validate the given URI against RFC2396, returning a
boolindicating its validity. - validate_
nom - Validate the given URI against RFC2396, returning a
nom::IResult<&str, &str>indicating its validity. - validate_
opt - Validate the given URI against RFC2396, returning an
Option<&str>indicating its validity. - validate_
res - Validate the given URI against RFC2396, returning an
anyhow::Result<&str>indicating its validity.