pub trait Pather: Send + Sync {
// Required methods
fn home_dir(&self) -> &Path;
fn dotfiles_root(&self) -> &Path;
fn data_dir(&self) -> &Path;
fn config_dir(&self) -> &Path;
fn cache_dir(&self) -> &Path;
fn xdg_config_home(&self) -> &Path;
fn shell_dir(&self) -> &Path;
// Provided methods
fn pack_path(&self, pack: &str) -> PathBuf { ... }
fn pack_data_dir(&self, pack: &str) -> PathBuf { ... }
fn handler_data_dir(&self, pack: &str, handler: &str) -> PathBuf { ... }
fn init_script_path(&self) -> PathBuf { ... }
}Expand description
Provides all path calculations for dodot.
Every path that dodot uses – XDG directories, pack locations,
handler data directories – is computed through this trait. This
keeps path logic centralised and makes testing straightforward:
construct a Pather whose directories all live under a temp dir.
Use &dyn Pather (trait objects) throughout the codebase.
Required Methods§
Sourcefn dotfiles_root(&self) -> &Path
fn dotfiles_root(&self) -> &Path
Root of the dotfiles repository.
Sourcefn config_dir(&self) -> &Path
fn config_dir(&self) -> &Path
XDG config directory for dodot (e.g. ~/.config/dodot).
Sourcefn xdg_config_home(&self) -> &Path
fn xdg_config_home(&self) -> &Path
XDG config home (e.g. ~/.config). Used by symlink handler
for subdirectory target mapping.
Provided Methods§
Sourcefn pack_data_dir(&self, pack: &str) -> PathBuf
fn pack_data_dir(&self, pack: &str) -> PathBuf
Data directory for a specific pack (e.g. .../data/packs/{pack}).
Sourcefn handler_data_dir(&self, pack: &str, handler: &str) -> PathBuf
fn handler_data_dir(&self, pack: &str, handler: &str) -> PathBuf
Data directory for a specific handler within a pack
(e.g. .../data/packs/{pack}/{handler}).
Sourcefn init_script_path(&self) -> PathBuf
fn init_script_path(&self) -> PathBuf
Path to the generated shell init script.