pub struct FileCredentialStore { /* private fields */ }Expand description
File-backed CredentialStore at a caller-supplied path.
The path mirrors the on-disk shape the claude CLI writes
(~/.claude/.credentials.json by convention); use
FileCredentialStore::default_claude_path to resolve that
location against the host’s home directory.
Implementations§
Source§impl FileCredentialStore
impl FileCredentialStore
Sourcepub fn with_path(path: impl Into<PathBuf>) -> Self
pub fn with_path(path: impl Into<PathBuf>) -> Self
Build a store rooted at the given file path.
Sourcepub fn default_claude_path() -> ClaudeCodeAuthResult<PathBuf>
pub fn default_claude_path() -> ClaudeCodeAuthResult<PathBuf>
Resolve ~/.claude/.credentials.json against the host’s
home directory (HOME on Unix, USERPROFILE on Windows).
Returns ClaudeCodeAuthError::HomeUnresolved when neither
is set.
Trait Implementations§
Source§impl Clone for FileCredentialStore
impl Clone for FileCredentialStore
Source§fn clone(&self) -> FileCredentialStore
fn clone(&self) -> FileCredentialStore
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 moreSource§impl CredentialStore for FileCredentialStore
impl CredentialStore for FileCredentialStore
Source§fn load<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = ClaudeCodeAuthResult<Option<CredentialFile>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn load<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = ClaudeCodeAuthResult<Option<CredentialFile>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Load the current credential envelope, or
None if the
backend holds no credential yet.Source§fn save<'life0, 'life1, 'async_trait>(
&'life0 self,
file: &'life1 CredentialFile,
) -> Pin<Box<dyn Future<Output = ClaudeCodeAuthResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn save<'life0, 'life1, 'async_trait>(
&'life0 self,
file: &'life1 CredentialFile,
) -> Pin<Box<dyn Future<Output = ClaudeCodeAuthResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Persist a refreshed credential envelope. Backends that
cannot retain state (e.g. a read-only env var) return
ClaudeCodeAuthError::Io with a descriptive message —
the provider surfaces that to the operator.Auto Trait Implementations§
impl Freeze for FileCredentialStore
impl RefUnwindSafe for FileCredentialStore
impl Send for FileCredentialStore
impl Sync for FileCredentialStore
impl Unpin for FileCredentialStore
impl UnsafeUnpin for FileCredentialStore
impl UnwindSafe for FileCredentialStore
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