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<Self, ParseError>
pub fn new(path: impl AsRef<str>) -> Result<Self, ParseError>
Like Path::new but path
must not begin with /
and may be .
.
pub fn dot() -> Self
pub fn is_dot(&self) -> bool
pub fn parent(&self) -> Option<Self>
pub fn split(&self) -> Vec<Name>
pub fn basename(&self) -> Option<&Name>
pub fn to_path_buf(&self) -> PathBuf
pub fn extend(&mut self, other: Self)
pub fn push(&mut self, segment: Name)
pub fn pop_front(&mut self) -> Option<Name>
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<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::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<RelativePath> for String
impl From<RelativePath> for String
Source§fn from(path: RelativePath) -> String
fn from(path: RelativePath) -> String
Converts to this type from the input type.
Source§impl From<Vec<BoundedName<MAX_NAME_LENGTH>>> for RelativePath
impl From<Vec<BoundedName<MAX_NAME_LENGTH>>> for RelativePath
Source§impl FromStr for RelativePath
impl FromStr for RelativePath
Source§impl Hash for RelativePath
impl Hash for RelativePath
Source§impl IterablePath for RelativePath
impl IterablePath for RelativePath
Source§fn iter_segments(&self) -> impl DoubleEndedIterator<Item = &Name> + Send
fn iter_segments(&self) -> impl DoubleEndedIterator<Item = &Name> + Send
Returns a double-sided iterator over the segments in this path.
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
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
)