pub struct OsFs;Expand description
Filesystem implementation that delegates to std::fs.
Every io::Error is wrapped with the path that caused it via
DodotError::Fs.
Implementations§
Trait Implementations§
Source§impl Fs for OsFs
impl Fs for OsFs
Source§fn stat(&self, path: &Path) -> Result<FsMetadata>
fn stat(&self, path: &Path) -> Result<FsMetadata>
Returns metadata for the path, following symlinks.
Source§fn lstat(&self, path: &Path) -> Result<FsMetadata>
fn lstat(&self, path: &Path) -> Result<FsMetadata>
Returns metadata for the path without following symlinks.
Source§fn open_read(&self, path: &Path) -> Result<Box<dyn Read + Send + Sync>>
fn open_read(&self, path: &Path) -> Result<Box<dyn Read + Send + Sync>>
Opens the file for reading in a streaming fashion. Read more
Source§fn read_to_string(&self, path: &Path) -> Result<String>
fn read_to_string(&self, path: &Path) -> Result<String>
Reads the entire file as a UTF-8 string.
Source§fn write_file(&self, path: &Path, contents: &[u8]) -> Result<()>
fn write_file(&self, path: &Path, contents: &[u8]) -> Result<()>
Writes
contents to path, creating or truncating the file.Source§fn symlink(&self, original: &Path, link: &Path) -> Result<()>
fn symlink(&self, original: &Path, link: &Path) -> Result<()>
Creates a symbolic link at
link pointing to original.Source§fn remove_dir_all(&self, path: &Path) -> Result<()>
fn remove_dir_all(&self, path: &Path) -> Result<()>
Removes a directory and all of its contents.
Source§fn is_symlink(&self, path: &Path) -> bool
fn is_symlink(&self, path: &Path) -> bool
Returns
true if path is a symlink (does not follow).Source§fn read_dir(&self, path: &Path) -> Result<Vec<DirEntry>>
fn read_dir(&self, path: &Path) -> Result<Vec<DirEntry>>
Lists entries in a directory, sorted by name.
Source§fn set_permissions(&self, path: &Path, mode: u32) -> Result<()>
fn set_permissions(&self, path: &Path, mode: u32) -> Result<()>
Sets file permissions (Unix mode).
Source§fn modified(&self, path: &Path) -> Result<SystemTime>
fn modified(&self, path: &Path) -> Result<SystemTime>
Returns the modification time of
path (follows symlinks).
Used by dodot refresh to compare deployed-side mtimes against
source-side mtimes when deciding whether to touch the source. Read moreSource§fn set_modified(&self, path: &Path, time: SystemTime) -> Result<()>
fn set_modified(&self, path: &Path, time: SystemTime) -> Result<()>
Sets the modification time of
path to time. Used by
dodot refresh to copy the deployed file’s mtime onto the
template source so git’s stat-cache invalidates and the next
git status re-reads the file (invoking the clean filter on
repos that have it installed). Read moreimpl Copy for OsFs
Auto Trait Implementations§
impl Freeze for OsFs
impl RefUnwindSafe for OsFs
impl Send for OsFs
impl Sync for OsFs
impl Unpin for OsFs
impl UnsafeUnpin for OsFs
impl UnwindSafe for OsFs
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