pub trait KnownPaths: Sealed {
// Required methods
fn home(&self) -> Option<PathBuf>;
fn config(&self) -> Option<PathBuf>;
fn data(&self) -> Option<PathBuf>;
fn runtime(&self) -> Option<PathBuf>;
}Expand description
The directories hotl reads and writes its own state in.
CONTRACT: an explicitly-set XDG_* or HOME wins on every platform.
That is not Unix bias — it is what keeps a Git Bash or MSYS2 user coherent
between their shell and hotl, and those are exactly the users who have a
POSIX shell on Windows.
Every method returns Option rather than a fallback path: “no home” must
stay expressible, because a missing $HOME is how the config layer already
decides there is no user rules tier. Narrower, never wider.
Required Methods§
fn home(&self) -> Option<PathBuf>
fn config(&self) -> Option<PathBuf>
fn data(&self) -> Option<PathBuf>
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".