pub struct PathResolver { /* private fields */ }Expand description
Resolver for Claude Code settings file paths.
Implementations§
Source§impl PathResolver
impl PathResolver
Sourcepub fn with_home(self, home: impl Into<PathBuf>) -> Self
pub fn with_home(self, home: impl Into<PathBuf>) -> Self
Creates a PathResolver with a custom home directory.
Sourcepub fn with_project(self, project: impl Into<PathBuf>) -> Self
pub fn with_project(self, project: impl Into<PathBuf>) -> Self
Creates a PathResolver with a custom project directory.
Sourcepub fn project_dir(&self) -> Result<PathBuf>
pub fn project_dir(&self) -> Result<PathBuf>
Returns the project directory path.
If not explicitly set, attempts to find the project root by looking for a .claude directory or .git directory in the current directory or its parents.
Sourcepub fn settings_path(&self, level: SettingsLevel) -> Result<PathBuf>
pub fn settings_path(&self, level: SettingsLevel) -> Result<PathBuf>
Returns the path for the settings file at the given level.
Sourcepub fn all_settings_paths(&self) -> Result<Vec<(SettingsLevel, PathBuf)>>
pub fn all_settings_paths(&self) -> Result<Vec<(SettingsLevel, PathBuf)>>
Returns all settings paths in order of precedence (highest first).
Sourcepub fn claude_dir(&self, level: SettingsLevel) -> Result<PathBuf>
pub fn claude_dir(&self, level: SettingsLevel) -> Result<PathBuf>
Returns the path to the .claude directory for a given level.
Trait Implementations§
Source§impl Clone for PathResolver
impl Clone for PathResolver
Source§fn clone(&self) -> PathResolver
fn clone(&self) -> PathResolver
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for PathResolver
impl Debug for PathResolver
Auto Trait Implementations§
impl Freeze for PathResolver
impl RefUnwindSafe for PathResolver
impl Send for PathResolver
impl Sync for PathResolver
impl Unpin for PathResolver
impl UnsafeUnpin for PathResolver
impl UnwindSafe for PathResolver
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