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 /
and may be .
.
pub fn dot() -> RelativePath
pub fn is_dot(&self) -> bool
pub fn parent(&self) -> Option<RelativePath>
pub fn split(&self) -> Vec<BoundedName<cm_types::::Name::{constant#0}>>
pub fn basename(&self) -> Option<&BoundedName<cm_types::::Name::{constant#0}>>
pub fn to_path_buf(&self) -> PathBuf
pub fn extend(&mut self, other: RelativePath)
pub fn push(&mut self, segment: BoundedName<cm_types::::Name::{constant#0}>)
pub fn pop_front( &mut self, ) -> Option<BoundedName<cm_types::::Name::{constant#0}>>
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 Default for RelativePath
impl Default for RelativePath
Source§fn default() -> RelativePath
fn default() -> RelativePath
Returns the “default value” for a type. Read more
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 From<Vec<BoundedName<cm_types::::Name::{constant#0}>>> for RelativePath
impl From<Vec<BoundedName<cm_types::::Name::{constant#0}>>> for RelativePath
Source§fn from(
segments: Vec<BoundedName<cm_types::::Name::{constant#0}>>,
) -> RelativePath
fn from( segments: Vec<BoundedName<cm_types::::Name::{constant#0}>>, ) -> RelativePath
Converts to this type from the input type.
Source§impl FromStr for RelativePath
impl FromStr for RelativePath
Source§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) -> impl DoubleEndedIterator + Send
fn iter_segments(&self) -> impl DoubleEndedIterator + Send
Returns a double-sided iterator over the segments in this path.
Source§impl NativeIntoFidl<Option<String>> for RelativePath
impl NativeIntoFidl<Option<String>> for RelativePath
fn native_into_fidl(self) -> Option<String>
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§impl PartialOrd for RelativePath
impl PartialOrd for RelativePath
Source§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 Freeze for RelativePath
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)Source§impl<T, D> Encode<Ambiguous1, D> for Twhere
D: ResourceDialect,
impl<T, D> Encode<Ambiguous1, D> for Twhere
D: ResourceDialect,
Source§impl<T, D> Encode<Ambiguous2, D> for Twhere
D: ResourceDialect,
impl<T, D> Encode<Ambiguous2, D> for Twhere
D: ResourceDialect,
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.