Struct cml::RelativePath
source · pub struct RelativePath { /* private fields */ }
Expand description
Same as Path except the path does not begin with /
.
Implementations§
source§impl RelativePath
impl RelativePath
sourcepub fn new(path: impl AsRef<str>) -> Result<RelativePath, ParseError>
pub fn new(path: impl AsRef<str>) -> Result<RelativePath, ParseError>
Like Path::new but path
must not begin with /
.
pub fn parent(&self) -> Option<RelativePath>
pub fn split(&self) -> Vec<BoundedName<cm_types::::Name::{constant#0}>>
pub fn basename(&self) -> &BoundedName<cm_types::::Name::{constant#0}>
pub fn to_path_buf(&self) -> PathBuf
Trait Implementations§
source§impl Clone for RelativePath
impl Clone for RelativePath
source§fn clone(&self) -> RelativePath
fn clone(&self) -> RelativePath
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for RelativePath
impl Debug for RelativePath
source§impl<'de> Deserialize<'de> for RelativePath
impl<'de> Deserialize<'de> for RelativePath
source§fn deserialize<D>(
deserializer: D
) -> Result<RelativePath, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
fn deserialize<D>(
deserializer: D
) -> Result<RelativePath, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl Display for RelativePath
impl Display for RelativePath
source§impl FromStr for RelativePath
impl FromStr for RelativePath
§type Err = ParseError
type Err = ParseError
The associated error which can be returned from parsing.
source§fn from_str(path: &str) -> Result<RelativePath, <RelativePath as FromStr>::Err>
fn from_str(path: &str) -> Result<RelativePath, <RelativePath as FromStr>::Err>
Parses a string
s
to return a value of this type. Read moresource§impl Hash for RelativePath
impl Hash for RelativePath
source§impl IterablePath for RelativePath
impl IterablePath for RelativePath
source§fn iter_segments(
&self
) -> Box<dyn DoubleEndedIterator<Item = &BoundedName<cm_types::::Name::{constant#0}>> + '_>
fn iter_segments( &self ) -> Box<dyn DoubleEndedIterator<Item = &BoundedName<cm_types::::Name::{constant#0}>> + '_>
Returns a double-sided iterator over the segments in this path.
source§impl NativeIntoFidl<String> for RelativePath
impl NativeIntoFidl<String> for RelativePath
fn native_into_fidl(self) -> String
source§impl Ord for RelativePath
impl Ord for RelativePath
source§fn cmp(&self, other: &RelativePath) -> Ordering
fn cmp(&self, other: &RelativePath) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
source§impl PartialEq for RelativePath
impl PartialEq for RelativePath
source§fn eq(&self, other: &RelativePath) -> bool
fn eq(&self, other: &RelativePath) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl PartialOrd for RelativePath
impl PartialOrd for RelativePath
source§fn partial_cmp(&self, other: &RelativePath) -> Option<Ordering>
fn partial_cmp(&self, other: &RelativePath) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moresource§impl Serialize for RelativePath
impl Serialize for RelativePath
source§fn serialize<S>(
&self,
serializer: S
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
fn serialize<S>(
&self,
serializer: S
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl Eq for RelativePath
impl StructuralPartialEq for RelativePath
Auto Trait Implementations§
impl RefUnwindSafe for RelativePath
impl Send for RelativePath
impl Sync for RelativePath
impl Unpin for RelativePath
impl UnwindSafe for RelativePath
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<T> Encode<Ambiguous1> for T
impl<T> Encode<Ambiguous1> for T
source§impl<T> Encode<Ambiguous2> for T
impl<T> Encode<Ambiguous2> for T
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.