pub struct SourceRoot { /* private fields */ }Implementations§
Source§impl SourceRoot
impl SourceRoot
pub fn new(path: impl Into<PathBuf>) -> SourceRoot
pub fn path(&self) -> &Path
Sourcepub fn host_path(&self, logical: &Path) -> PathBuf
pub fn host_path(&self, logical: &Path) -> PathBuf
Map a logical path onto the host without following symlinks.
Sourcepub fn resolve(&self, logical: &Path) -> Result<Option<Resolved>>
pub fn resolve(&self, logical: &Path) -> Result<Option<Resolved>>
Resolve a logical path, following symlinks within the root.
Returns Ok(None) when the path does not exist. Symlinks are recorded so
that the bundle can reproduce the original link structure.
Sourcepub fn read(&self, logical: &Path) -> Result<Option<Vec<u8>>>
pub fn read(&self, logical: &Path) -> Result<Option<Vec<u8>>>
Read a file identified by a logical path.
pub fn exists(&self, logical: &Path) -> bool
pub fn is_dir(&self, logical: &Path) -> bool
Trait Implementations§
Source§impl Clone for SourceRoot
impl Clone for SourceRoot
Source§fn clone(&self) -> SourceRoot
fn clone(&self) -> SourceRoot
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 moreAuto 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