Struct camino::Utf8PrefixComponent [−][src]
#[repr(transparent)]pub struct Utf8PrefixComponent<'a>(_);Expand description
A structure wrapping a Windows path prefix as well as its unparsed string representation.
In addition to the parsed Utf8Prefix information returned by kind,
Utf8PrefixComponent also holds the raw and unparsed str slice,
returned by as_str.
Instances of this struct can be obtained by matching against the
Prefix variant on Utf8Component.
Does not occur on Unix.
Examples
use camino::{Utf8Component, Utf8Path, Utf8Prefix};
use std::ffi::OsStr;
let path = Utf8Path::new(r"c:\you\later\");
match path.components().next().unwrap() {
Utf8Component::Prefix(prefix_component) => {
assert_eq!(Utf8Prefix::Disk(b'C'), prefix_component.kind());
assert_eq!("c:", prefix_component.as_str());
}
_ => unreachable!(),
}Implementations
Returns the parsed prefix data.
See Utf8Prefix’s documentation for more information on the different
kinds of prefixes.
Trait Implementations
This method tests for self and other values to be equal, and is used
by ==. Read more
This method tests for !=.
This method returns an ordering between self and other values if one exists. Read more
This method tests less than (for self and other) and is used by the < operator. Read more
This method tests less than or equal to (for self and other) and is used by the <=
operator. Read more
This method tests greater than (for self and other) and is used by the > operator. Read more
Auto Trait Implementations
impl<'a> RefUnwindSafe for Utf8PrefixComponent<'a>
impl<'a> Send for Utf8PrefixComponent<'a>
impl<'a> Sync for Utf8PrefixComponent<'a>
impl<'a> Unpin for Utf8PrefixComponent<'a>
impl<'a> UnwindSafe for Utf8PrefixComponent<'a>
Blanket Implementations
Mutably borrows from an owned value. Read more