pub struct SettingsLoader { /* private fields */ }Expand description
Builder/loader for the settings layers.
Defaults to reading from ~/.claude/. If
Self::project_root is set, also reads from
<project_root>/.claude/. Missing files are not errors – the
corresponding Settings field stays None.
Implementations§
Source§impl SettingsLoader
impl SettingsLoader
Sourcepub fn home() -> Result<Self>
pub fn home() -> Result<Self>
Construct with the default user root ~/.claude/ and no
project root. Add a project root with Self::project_root.
Sourcepub fn at(user_root: impl Into<PathBuf>, project_root: Option<PathBuf>) -> Self
pub fn at(user_root: impl Into<PathBuf>, project_root: Option<PathBuf>) -> Self
Construct with explicit roots. Useful for tests (point both
at tempdirs) and non-default installs. project_root may be
None if no project context applies.
Sourcepub fn project_root(self, dir: impl Into<PathBuf>) -> Self
pub fn project_root(self, dir: impl Into<PathBuf>) -> Self
Set or override the project root. Note this is the .claude
parent – i.e. the project directory itself, not
<project>/.claude. The loader appends /.claude internally.
Sourcepub fn user_root_path(&self) -> &Path
pub fn user_root_path(&self) -> &Path
The configured user root (typically ~/.claude).
Sourcepub fn project_root_path(&self) -> Option<&Path>
pub fn project_root_path(&self) -> Option<&Path>
The configured project root, if any.
Trait Implementations§
Source§impl Clone for SettingsLoader
impl Clone for SettingsLoader
Source§fn clone(&self) -> SettingsLoader
fn clone(&self) -> SettingsLoader
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 moreAuto Trait Implementations§
impl Freeze for SettingsLoader
impl RefUnwindSafe for SettingsLoader
impl Send for SettingsLoader
impl Sync for SettingsLoader
impl Unpin for SettingsLoader
impl UnsafeUnpin for SettingsLoader
impl UnwindSafe for SettingsLoader
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