pub struct PKG_PATH { /* private fields */ }
Methods from Deref<Target = NamespacePath>§
pub fn is_root(&self) -> bool
Sourcepub fn split(&self) -> Vec<BoundedName<cm_types::::Name::{constant#0}>>
pub fn split(&self) -> Vec<BoundedName<cm_types::::Name::{constant#0}>>
Splits the path according to "/"
.
pub fn to_path_buf(&self) -> PathBuf
Sourcepub fn parent(&self) -> Option<NamespacePath>
pub fn parent(&self) -> Option<NamespacePath>
Returns a path that represents the parent directory of this one, or None if this is a root dir.
Sourcepub fn has_prefix(&self, prefix: &NamespacePath) -> bool
pub fn has_prefix(&self, prefix: &NamespacePath) -> bool
Returns whether prefix
is a prefix of self
in terms of path segments.
For example:
Path("/pkg/data").has_prefix("/pkg") == true
Path("/pkg_data").has_prefix("/pkg") == false
Sourcepub fn basename(&self) -> Option<&BoundedName<cm_types::::Name::{constant#0}>>
pub fn basename(&self) -> Option<&BoundedName<cm_types::::Name::{constant#0}>>
The last path segment, or None.
Trait Implementations§
Source§impl Deref for PKG_PATH
impl Deref for PKG_PATH
Source§type Target = NamespacePath
type Target = NamespacePath
The resulting type after dereferencing.
Source§fn deref(&self) -> &NamespacePath
fn deref(&self) -> &NamespacePath
Dereferences the value.
impl LazyStatic for PKG_PATH
Auto Trait Implementations§
impl Freeze for PKG_PATH
impl RefUnwindSafe for PKG_PATH
impl Send for PKG_PATH
impl Sync for PKG_PATH
impl Unpin for PKG_PATH
impl UnwindSafe for PKG_PATH
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