pub type PathElementCI<'a> = PathElementGeneric<'a, CaseInsensitive>;Expand description
Case-insensitive path element (compile-time case sensitivity).
Alias for PathElementGeneric<'a, CaseInsensitive>. Implements Hash.
Aliased Type§
pub struct PathElementCI<'a> { /* private fields */ }Implementations§
Source§impl<'a> PathElementCI<'a>
impl<'a> PathElementCI<'a>
Sourcepub fn from_bytes(original: impl Into<Cow<'a, [u8]>>) -> Result<Self>
pub fn from_bytes(original: impl Into<Cow<'a, [u8]>>) -> Result<Self>
Creates a new case-insensitive path element from a byte slice.
Invalid UTF-8 is accepted; see Normalization pipeline step 0.
§Errors
Returns Error if the name is invalid (empty, ., ..,
or contains /).
Sourcepub fn from_os_str(original: impl Into<Cow<'a, OsStr>>) -> Result<Self>
Available on crate feature std only.
pub fn from_os_str(original: impl Into<Cow<'a, OsStr>>) -> Result<Self>
std only.Creates a new case-insensitive path element from an OS string.
Invalid UTF-8 is accepted; see Normalization pipeline step 0.
§Errors
Returns Error if the name is invalid (empty, ., ..,
or contains /).
Trait Implementations§
Source§impl Hash for PathElementCI<'_>
Hashes by normalized(), consistent with PartialEq. Only
implemented for typed variants, not PathElement.
impl Hash for PathElementCI<'_>
Hashes by normalized(), consistent with PartialEq. Only
implemented for typed variants, not PathElement.
Source§impl<'a> TryFrom<PathElementGeneric<'a, CaseSensitivity>> for PathElementCI<'a>
Attempts to convert a runtime-dynamic PathElement into a PathElementCI.
impl<'a> TryFrom<PathElementGeneric<'a, CaseSensitivity>> for PathElementCI<'a>
Attempts to convert a runtime-dynamic PathElement into a PathElementCI.
Succeeds if the element is case-insensitive. On failure, returns the element
re-wrapped as a PathElementCS in the Err variant (no data is lost).