pub fn path_segment<S: Spec>(s: &str) -> Result<(), Error>Expand description
Validates IRI path segment.
ยงExamples
use iri_string::{spec::UriSpec, validate::path_segment};
assert!(path_segment::<UriSpec>("").is_ok());
assert!(path_segment::<UriSpec>("escaped-%2F-slash").is_ok());
assert!(path_segment::<UriSpec>("non-%99-utf-8").is_ok());
// A path segment itself cannot contain an unescaped slash.
assert!(path_segment::<UriSpec>("foo/bar").is_err());