pub struct SourceRoot { /* private fields */ }Expand description
Canonicalised view of the directory passed via --source-root. The
canonical path is computed once at construction so every later resolve
walks the same tree.
Implementations§
Source§impl SourceRoot
impl SourceRoot
Sourcepub fn from_arg_or_cwd(arg: Option<&Path>) -> Result<Self, ManifestError>
pub fn from_arg_or_cwd(arg: Option<&Path>) -> Result<Self, ManifestError>
Build a SourceRoot from an explicit --source-root argument, or
fall back to the current working directory. The resulting path is
canonicalised so symlinks resolve to a stable target.
pub fn path(&self) -> &Path
pub fn manifests_dir(&self) -> PathBuf
Trait Implementations§
Source§impl Clone for SourceRoot
impl Clone for SourceRoot
Auto Trait Implementations§
impl Freeze for SourceRoot
impl RefUnwindSafe for SourceRoot
impl Send for SourceRoot
impl Sync for SourceRoot
impl Unpin for SourceRoot
impl UnsafeUnpin for SourceRoot
impl UnwindSafe for SourceRoot
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