pub struct RepositoryRoot(PathBuf);Expand description
A canonical repository root directory.
The only constructor canonicalizes the path, so every value holds an absolute path with no symlinks in it.
Tuple Fields§
§0: PathBufImplementations§
Source§impl RepositoryRoot
impl RepositoryRoot
Sourcepub fn new(path: &Path) -> Result<Self, PathError>
pub fn new(path: &Path) -> Result<Self, PathError>
Canonicalize path into a repository root.
§Errors
Returns an error when the path does not exist or cannot be read.
Source§impl RepositoryRoot
impl RepositoryRoot
Sourcepub fn read(&self, path: &RepositoryPath) -> Result<Option<Vec<u8>>, FilesError>
pub fn read(&self, path: &RepositoryPath) -> Result<Option<Vec<u8>>, FilesError>
The content of the file at path, or None when nothing exists
there.
§Errors
Returns an error when a parent or the file itself is a symlink or the file cannot be read.
Trait Implementations§
Source§impl Clone for RepositoryRoot
impl Clone for RepositoryRoot
Source§fn clone(&self) -> RepositoryRoot
fn clone(&self) -> RepositoryRoot
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 RepositoryRoot
impl Debug for RepositoryRoot
impl Eq for RepositoryRoot
Source§impl PartialEq for RepositoryRoot
impl PartialEq for RepositoryRoot
impl StructuralPartialEq for RepositoryRoot
Auto Trait Implementations§
impl Freeze for RepositoryRoot
impl RefUnwindSafe for RepositoryRoot
impl Send for RepositoryRoot
impl Sync for RepositoryRoot
impl Unpin for RepositoryRoot
impl UnsafeUnpin for RepositoryRoot
impl UnwindSafe for RepositoryRoot
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,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.