Skip to main content

KnownPaths

Trait KnownPaths 

Source
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§

Source

fn home(&self) -> Option<PathBuf>

Source

fn config(&self) -> Option<PathBuf>

Source

fn data(&self) -> Option<PathBuf>

Source

fn runtime(&self) -> Option<PathBuf>

A directory for sockets, pipes and pidfiles that need not survive a reboot. None where the platform has no such concept.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§