pub struct FileHandler;Expand description
Moves, stores, and creates files and symlinks.
Implementations§
Source§impl FileHandler
impl FileHandler
Sourcepub fn store_file(src: &Path, dst: &Path) -> Result<()>
pub fn store_file(src: &Path, dst: &Path) -> Result<()>
Store a file in the dotfiles directory, create a symlink at the original source of the stowed file.
Sourcepub fn move_file(src: &Path, dst: &Path) -> Result<()>
pub fn move_file(src: &Path, dst: &Path) -> Result<()>
Read file at path src and write to created/truncated file at path dst.
Sourcepub fn create_symlink(src: &Path, dst: &Path) -> Result<()>
pub fn create_symlink(src: &Path, dst: &Path) -> Result<()>
Create a symlink at “dst” pointing to “src.”
For Unix platforms, std::os::unix::fs::symlink is used to create
symlinks. For Windows, std::os::windows::fs::symlink_file is used.
Trait Implementations§
Source§impl Clone for FileHandler
impl Clone for FileHandler
Source§fn clone(&self) -> FileHandler
fn clone(&self) -> FileHandler
Returns a duplicate of the value. Read more
1.0.0 · 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 FileHandler
impl Debug for FileHandler
impl Copy for FileHandler
Auto Trait Implementations§
impl Freeze for FileHandler
impl RefUnwindSafe for FileHandler
impl Send for FileHandler
impl Sync for FileHandler
impl Unpin for FileHandler
impl UnwindSafe for FileHandler
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