pub struct RootedPath { /* private fields */ }Expand description
A path in a specific virtual file system root.
This identifies a location in a project or package.
Implementations§
Source§impl RootedPath
impl RootedPath
Sourcepub fn new(root: VirtualRoot, vpath: VirtualPath) -> Self
pub fn new(root: VirtualRoot, vpath: VirtualPath) -> Self
Create a rooted path from a root and a virtual path within the root.
Sourcepub fn root(&self) -> &VirtualRoot
pub fn root(&self) -> &VirtualRoot
The root this path resides in.
Sourcepub fn package(&self) -> Option<&PackageSpec>
👎Deprecated: use root instead
pub fn package(&self) -> Option<&PackageSpec>
use root instead
The package the path resides in, if any.
Sourcepub fn vpath(&self) -> &VirtualPath
pub fn vpath(&self) -> &VirtualPath
The absolute and normalized path to the file within the project or package.
Sourcepub fn map(&self, f: impl FnOnce(&VirtualPath) -> VirtualPath) -> Self
pub fn map(&self, f: impl FnOnce(&VirtualPath) -> VirtualPath) -> Self
Maps the virtual path while retaining the root.
Trait Implementations§
Source§impl Clone for RootedPath
impl Clone for RootedPath
Source§fn clone(&self) -> RootedPath
fn clone(&self) -> RootedPath
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 RootedPath
impl Debug for RootedPath
impl Eq for RootedPath
Source§impl Hash for RootedPath
impl Hash for RootedPath
Source§impl PartialEq for RootedPath
impl PartialEq for RootedPath
Source§fn eq(&self, other: &RootedPath) -> bool
fn eq(&self, other: &RootedPath) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for RootedPath
Auto Trait Implementations§
impl Freeze for RootedPath
impl RefUnwindSafe for RootedPath
impl Send for RootedPath
impl Sync for RootedPath
impl Unpin for RootedPath
impl UnsafeUnpin for RootedPath
impl UnwindSafe for RootedPath
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> 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.Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more