pub struct UserEnv {
pub home: Option<Utf8PathBuf>,
pub claude_config_dir: Option<Utf8PathBuf>,
pub xdg_state_home: Option<Utf8PathBuf>,
pub xdg_cache_home: Option<Utf8PathBuf>,
pub plan_zone: Option<String>,
pub docs_scratch: Option<String>,
}Expand description
What the process environment carries, read once and passed down.
Fields§
§home: Option<Utf8PathBuf>The invoking user’s home directory.
claude_config_dir: Option<Utf8PathBuf>Where Claude Code’s configuration directory was moved to.
xdg_state_home: Option<Utf8PathBuf>The XDG state base directory.
xdg_cache_home: Option<Utf8PathBuf>The XDG cache base directory.
plan_zone: Option<String>What the plan-zone variable carries.
docs_scratch: Option<String>What the docs-scratch variable carries.
Implementations§
Source§impl UserEnv
impl UserEnv
Sourcepub fn from_process() -> Self
pub fn from_process() -> Self
Read every variable this module resolves from, once.
Sourcepub fn state_root(&self) -> Option<PathEntry>
pub fn state_root(&self) -> Option<PathEntry>
The state root, through the XDG variable or its default.
Sourcepub fn legacy_state_root(&self) -> Option<Utf8PathBuf>
pub fn legacy_state_root(&self) -> Option<Utf8PathBuf>
The home-relative state root, whatever the variable says.
One fallback read lives here: a receipt written before the state root
followed XDG_STATE_HOME, and the two gate files that release left
under the retired shared root.
Sourcepub fn cache_root(&self) -> Option<PathEntry>
pub fn cache_root(&self) -> Option<PathEntry>
The cache root, through the XDG variable or its default.
Sourcepub fn agent_root(&self, id: AgentId) -> Option<AgentRootEntry>
pub fn agent_root(&self, id: AgentId) -> Option<AgentRootEntry>
One agent skill root, resolved with what decided it.
Sourcepub fn agent_roots(&self, selected: &[AgentId]) -> Vec<AgentRootEntry>
pub fn agent_roots(&self, selected: &[AgentId]) -> Vec<AgentRootEntry>
Every selected agent root, in table order, deduplicated by path.
Two selected roots that resolve to one directory are one destination. Planning it twice would list every file twice and make an install compare a write against itself.
Sourcepub fn user_paths(&self) -> Option<UserPaths>
pub fn user_paths(&self) -> Option<UserPaths>
Every user-scope path, with every agent root selected.
Trait Implementations§
impl Eq for UserEnv
impl StructuralPartialEq for UserEnv
Auto Trait Implementations§
impl Freeze for UserEnv
impl RefUnwindSafe for UserEnv
impl Send for UserEnv
impl Sync for UserEnv
impl Unpin for UserEnv
impl UnsafeUnpin for UserEnv
impl UnwindSafe for UserEnv
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
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
key and return true if they are equal.