#[non_exhaustive]pub enum PathStrategy {
System,
Xdg,
CustomBase(PathBuf),
}Expand description
Path resolution strategy.
Determines how configuration and data directories are resolved.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
System
Use OS-standard directories (default).
- Linux:
~/.config/(XDG_CONFIG_HOME) - macOS:
~/Library/Application Support/ - Windows:
%APPDATA%
Xdg
Force XDG Base Directory layout on all platforms.
Respects XDG_CONFIG_HOME / XDG_DATA_HOME when set to an absolute
path (relative or empty values are ignored, per the XDG Base Directory
specification); otherwise falls back to ~/.config/ for config and
~/.local/share/ for data on all platforms (Linux, macOS, Windows).
This is useful for applications that want consistent paths across platforms (e.g., VSCode, Neovim, orcs).
CustomBase(PathBuf)
Use a custom base directory.
Config resolves to <base>/<app_name>, while data resolves to
<base>/data/<app_name> (the extra data segment keeps config and
data separated under a single base).
Trait Implementations§
Source§impl Clone for PathStrategy
impl Clone for PathStrategy
Source§fn clone(&self) -> PathStrategy
fn clone(&self) -> PathStrategy
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 PathStrategy
impl Debug for PathStrategy
Source§impl Default for PathStrategy
impl Default for PathStrategy
Source§fn default() -> PathStrategy
fn default() -> PathStrategy
Returns the “default value” for a type. Read more
impl Eq for PathStrategy
Source§impl PartialEq for PathStrategy
impl PartialEq for PathStrategy
impl StructuralPartialEq for PathStrategy
Auto Trait Implementations§
impl Freeze for PathStrategy
impl RefUnwindSafe for PathStrategy
impl Send for PathStrategy
impl Sync for PathStrategy
impl Unpin for PathStrategy
impl UnsafeUnpin for PathStrategy
impl UnwindSafe for PathStrategy
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.