pub struct SyncorPaths { /* private fields */ }Expand description
Canonical filesystem layout for Syncor’s config and data directories.
Follows an XDG-like convention: config: $HOME/.config/syncor/ data: $HOME/.local/share/syncor/
Implementations§
Source§impl SyncorPaths
impl SyncorPaths
Sourcepub fn with_home(home: &Path) -> Self
pub fn with_home(home: &Path) -> Self
Derive paths from an explicit home directory — useful in tests.
pub fn config_dir(&self) -> &Path
pub fn config_file(&self) -> PathBuf
pub fn links_file(&self) -> PathBuf
pub fn data_dir(&self) -> &Path
Sourcepub fn socket_path(&self) -> PathBuf
pub fn socket_path(&self) -> PathBuf
Unix-domain socket for daemon IPC.
Sourcepub fn link_repo_dir(&self, link_id: &LinkId) -> PathBuf
pub fn link_repo_dir(&self, link_id: &LinkId) -> PathBuf
Working directory for a specific link’s repo checkout.
Sourcepub fn link_state_db(&self) -> PathBuf
pub fn link_state_db(&self) -> PathBuf
SQLite database that holds link state / checkpoints.
Sourcepub fn link_lock_file(&self, link_id: &LinkId) -> PathBuf
pub fn link_lock_file(&self, link_id: &LinkId) -> PathBuf
Advisory lock file for a specific link.
Sourcepub fn ensure_dirs(&self) -> Result<()>
pub fn ensure_dirs(&self) -> Result<()>
Create all required directories, returning an error on failure.
Trait Implementations§
Source§impl Clone for SyncorPaths
impl Clone for SyncorPaths
Source§fn clone(&self) -> SyncorPaths
fn clone(&self) -> SyncorPaths
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 SyncorPaths
impl Debug for SyncorPaths
Auto Trait Implementations§
impl Freeze for SyncorPaths
impl RefUnwindSafe for SyncorPaths
impl Send for SyncorPaths
impl Sync for SyncorPaths
impl Unpin for SyncorPaths
impl UnsafeUnpin for SyncorPaths
impl UnwindSafe for SyncorPaths
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