pub struct FilesystemDataStore { /* private fields */ }Expand description
DataStore implementation backed by the real filesystem.
State is stored as symlinks and sentinel files under the XDG data directory. The double-link architecture works as follows:
~/dotfiles/vim/vimrc (source)
-> ~/.local/share/dodot/packs/vim/symlink/vimrc (data link)
-> ~/.vimrc (user link)Implementations§
Trait Implementations§
Source§impl DataStore for FilesystemDataStore
impl DataStore for FilesystemDataStore
Source§fn create_data_link(
&self,
pack: &str,
handler: &str,
source_file: &Path,
) -> Result<PathBuf>
fn create_data_link( &self, pack: &str, handler: &str, source_file: &Path, ) -> Result<PathBuf>
Creates an intermediate symlink in the datastore:
handler_data_dir(pack, handler) / filename -> source_file Read moreSource§fn create_user_link(
&self,
datastore_path: &Path,
user_path: &Path,
) -> Result<()>
fn create_user_link( &self, datastore_path: &Path, user_path: &Path, ) -> Result<()>
Creates a user-visible symlink:
user_path -> datastore_path Read moreSource§fn run_and_record(
&self,
pack: &str,
handler: &str,
executable: &str,
arguments: &[String],
sentinel: &str,
force: bool,
) -> Result<()>
fn run_and_record( &self, pack: &str, handler: &str, executable: &str, arguments: &[String], sentinel: &str, force: bool, ) -> Result<()>
Executes
command via shell and records a sentinel on success. Read moreSource§fn has_sentinel(
&self,
pack: &str,
handler: &str,
sentinel: &str,
) -> Result<bool>
fn has_sentinel( &self, pack: &str, handler: &str, sentinel: &str, ) -> Result<bool>
Checks whether a sentinel exists for this pack/handler.
Source§fn remove_state(&self, pack: &str, handler: &str) -> Result<()>
fn remove_state(&self, pack: &str, handler: &str) -> Result<()>
Removes all state for a pack/handler pair. Read more
Source§fn has_handler_state(&self, pack: &str, handler: &str) -> Result<bool>
fn has_handler_state(&self, pack: &str, handler: &str) -> Result<bool>
Checks if any state exists for a pack/handler pair.
Source§fn list_pack_handlers(&self, pack: &str) -> Result<Vec<String>>
fn list_pack_handlers(&self, pack: &str) -> Result<Vec<String>>
Lists handler names that have state for a pack.
Source§fn list_handler_sentinels(
&self,
pack: &str,
handler: &str,
) -> Result<Vec<String>>
fn list_handler_sentinels( &self, pack: &str, handler: &str, ) -> Result<Vec<String>>
Lists sentinel file names for a pack/handler.
Source§fn write_rendered_file(
&self,
pack: &str,
handler: &str,
filename: &str,
content: &[u8],
) -> Result<PathBuf>
fn write_rendered_file( &self, pack: &str, handler: &str, filename: &str, content: &[u8], ) -> Result<PathBuf>
Writes a regular file (not a symlink) into the datastore. Read more
Source§fn write_rendered_file_with_mode(
&self,
pack: &str,
handler: &str,
filename: &str,
content: &[u8],
mode: u32,
) -> Result<PathBuf>
fn write_rendered_file_with_mode( &self, pack: &str, handler: &str, filename: &str, content: &[u8], mode: u32, ) -> Result<PathBuf>
Like [
write_rendered_file], but applies mode atomically
at file-creation time so the rendered bytes never live on
disk under a more permissive mode (per secrets.lex §4.3
for whole-file age / gpg plaintext). Default impl
falls back to write_rendered_file followed by an
Fs::set_permissions chmod — semantically equivalent but
briefly leaves the file at the umask-default mode; real
impls should override with the atomic
Fs::write_file_with_mode path.Auto Trait Implementations§
impl Freeze for FilesystemDataStore
impl !RefUnwindSafe for FilesystemDataStore
impl Send for FilesystemDataStore
impl Sync for FilesystemDataStore
impl Unpin for FilesystemDataStore
impl UnsafeUnpin for FilesystemDataStore
impl !UnwindSafe for FilesystemDataStore
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