pub struct VirtualPathBuf { /* private fields */ }Expand description
Similar to the distinction with Path and PathBuf, this is a VirtualPath that owns the underlying data.
Implementations§
Methods from Deref<Target = VirtualPath>§
Sourcepub fn is_empty(&self) -> bool
pub fn is_empty(&self) -> bool
alias for Self::is_root
Sourcepub fn chroot(&self, new_root: &VirtualPath) -> Result<&Self, VirtualPathError>
pub fn chroot(&self, new_root: &VirtualPath) -> Result<&Self, VirtualPathError>
Return a new VirtualPath with a new root
Sourcepub fn is_inside(&self, other: &VirtualPath) -> bool
pub fn is_inside(&self, other: &VirtualPath) -> bool
Return true if the node pointed by “self” is contained in “other”, eventually recursively Return also true if self == other
Sourcepub fn top_level(&self) -> Option<&str>
pub fn top_level(&self) -> Option<&str>
Return the top level directory of this path, for example “a” in “/a/b/c”. Return None is
the provided path is the root
Sourcepub fn top_level_split(&self) -> Option<(&str, &Self)>
pub fn top_level_split(&self) -> Option<(&str, &Self)>
Return the path split in two components, the top level and the rest. For example, the path “a/b/c” will return Some(“a”, “/b/c”). Return None when called on a root path.
Sourcepub fn iter(&self) -> VirtualPathIterator<'_> ⓘ
pub fn iter(&self) -> VirtualPathIterator<'_> ⓘ
Return an iterator over the components of the path
Trait Implementations§
Source§impl AsRef<VirtualPath> for VirtualPathBuf
impl AsRef<VirtualPath> for VirtualPathBuf
Source§fn as_ref(&self) -> &VirtualPath
fn as_ref(&self) -> &VirtualPath
Converts this type into a shared reference of the (usually inferred) input type.
Source§impl Borrow<VirtualPath> for VirtualPathBuf
impl Borrow<VirtualPath> for VirtualPathBuf
Source§fn borrow(&self) -> &VirtualPath
fn borrow(&self) -> &VirtualPath
Immutably borrows from an owned value. Read more
Source§impl Clone for VirtualPathBuf
impl Clone for VirtualPathBuf
Source§fn clone(&self) -> VirtualPathBuf
fn clone(&self) -> VirtualPathBuf
Returns a duplicate 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 VirtualPathBuf
impl Debug for VirtualPathBuf
Source§impl Deref for VirtualPathBuf
impl Deref for VirtualPathBuf
Source§type Target = VirtualPath
type Target = VirtualPath
The resulting type after dereferencing.
Source§fn deref(&self) -> &VirtualPath
fn deref(&self) -> &VirtualPath
Dereferences the value.
Source§impl<'de> Deserialize<'de> for VirtualPathBuf
impl<'de> Deserialize<'de> for VirtualPathBuf
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 Hash for VirtualPathBuf
impl Hash for VirtualPathBuf
Source§impl Ord for VirtualPathBuf
impl Ord for VirtualPathBuf
Source§fn cmp(&self, other: &VirtualPathBuf) -> Ordering
fn cmp(&self, other: &VirtualPathBuf) -> 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<'a> PartialEq<&'a VirtualPath> for VirtualPathBuf
impl<'a> PartialEq<&'a VirtualPath> for VirtualPathBuf
Source§impl PartialEq<VirtualPathBuf> for &VirtualPath
impl PartialEq<VirtualPathBuf> for &VirtualPath
Source§impl PartialEq for VirtualPathBuf
impl PartialEq for VirtualPathBuf
Source§impl PartialOrd for VirtualPathBuf
impl PartialOrd for VirtualPathBuf
Source§impl Serialize for VirtualPathBuf
impl Serialize for VirtualPathBuf
impl Eq for VirtualPathBuf
impl StructuralPartialEq for VirtualPathBuf
Auto Trait Implementations§
impl Freeze for VirtualPathBuf
impl RefUnwindSafe for VirtualPathBuf
impl Send for VirtualPathBuf
impl Sync for VirtualPathBuf
impl Unpin for VirtualPathBuf
impl UnsafeUnpin for VirtualPathBuf
impl UnwindSafe for VirtualPathBuf
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§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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.