pub struct HostContext {
pub home: PathBuf,
pub config_dir: PathBuf,
pub state_dir: PathBuf,
pub platform: Platform,
pub architecture: Architecture,
}Expand description
All machine-specific paths are explicit; core services never discover HOME themselves.
Fields§
§home: PathBuf§config_dir: PathBuf§state_dir: PathBuf§platform: Platform§architecture: ArchitectureImplementations§
Source§impl HostContext
impl HostContext
pub fn new( home: PathBuf, xdg_config_home: Option<PathBuf>, xdg_state_home: Option<PathBuf>, platform: Platform, architecture: Architecture, ) -> Result<Self>
Sourcepub fn from_env() -> Result<Self>
pub fn from_env() -> Result<Self>
Called at the application boundary only. Empty XDG values mean unset.
pub fn local_config_path(&self) -> PathBuf
Trait Implementations§
Source§impl Clone for HostContext
impl Clone for HostContext
Source§impl Debug for HostContext
impl Debug for HostContext
Auto Trait Implementations§
impl Forget for HostContext
impl Freeze for HostContext
impl Move for HostContext
impl RefUnwindSafe for HostContext
impl Send for HostContext
impl Sync for HostContext
impl Unpin for HostContext
impl UnsafeUnpin for HostContext
impl UnwindSafe for HostContext
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