Skip to main content

XdgPather

Struct XdgPather 

Source
pub struct XdgPather { /* private fields */ }
Expand description

XDG-compliant path resolver.

Reads standard environment variables (HOME, XDG_DATA_HOME, etc.) and the dodot-specific DOTFILES_ROOT. All paths can also be set explicitly via the builder for testing.

Implementations§

Source§

impl XdgPather

Source

pub fn builder() -> XdgPatherBuilder

Creates a builder for configuring an XdgPather.

Source

pub fn from_env() -> Result<Self>

Creates an XdgPather using environment variables and XDG defaults.

Trait Implementations§

Source§

impl Clone for XdgPather

Source§

fn clone(&self) -> XdgPather

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for XdgPather

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Pather for XdgPather

Source§

fn home_dir(&self) -> &Path

The user’s home directory (e.g. /home/alice).
Source§

fn dotfiles_root(&self) -> &Path

Root of the dotfiles repository.
Source§

fn data_dir(&self) -> &Path

XDG data directory for dodot (e.g. ~/.local/share/dodot).
Source§

fn config_dir(&self) -> &Path

XDG config directory for dodot (e.g. ~/.config/dodot).
Source§

fn cache_dir(&self) -> &Path

XDG cache directory for dodot (e.g. ~/.cache/dodot).
Source§

fn xdg_config_home(&self) -> &Path

XDG config home (e.g. ~/.config). Used by symlink handler for subdirectory target mapping.
Source§

fn app_support_dir(&self) -> &Path

Application-support root, the third filesystem coordinate the symlink resolver understands. Read more
Source§

fn shell_dir(&self) -> &Path

Shell scripts directory (e.g. ~/.local/share/dodot/shell).
Source§

fn pack_path(&self, pack: &str) -> PathBuf

Absolute path to a pack’s source directory.
Source§

fn pack_data_dir(&self, pack: &str) -> PathBuf

Data directory for a specific pack (e.g. .../data/packs/{pack}).
Source§

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}).
Source§

fn log_dir(&self) -> PathBuf

Log directory for dodot (e.g. ~/.cache/dodot/logs).
Source§

fn init_script_path(&self) -> PathBuf

Path to the generated shell init script.
Source§

fn deployment_map_path(&self) -> PathBuf

Path to the deployment map TSV, overwritten on every up / down. See docs/proposals/profiling.lex §3.2.
Source§

fn last_up_path(&self) -> PathBuf

Path to a single-line file recording the unix timestamp of the most recent successful dodot up. Used by dodot probe shell-init to flag profiles captured before that up as stale. Absent until the first up runs.
Source§

fn probes_shell_init_dir(&self) -> PathBuf

Directory where shell-init profile reports are written, one TSV per shell start. See docs/proposals/profiling.lex §3.1.
Source§

fn probes_brew_cache_dir(&self) -> PathBuf

On-disk cache for homebrew-cask probe data. One JSON file per cask token; TTL-based invalidation. See docs/proposals/macos-paths.lex §8.2. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more