pub struct CredentialStore { /* private fields */ }Expand description
A file-backed credential store with an injectable path and owner policy.
Implementations§
Source§impl CredentialStore
impl CredentialStore
pub fn at(path: impl Into<PathBuf>) -> Self
pub fn with_owner_provider( path: impl Into<PathBuf>, owner: Arc<dyn OwnerIdProvider>, ) -> Self
pub fn path(&self) -> &Path
pub fn lock_path(&self) -> PathBuf
pub fn acquire_lock(&self) -> Result<CredentialLock>
pub fn read(&self) -> Result<Option<CredentialDocument>>
pub fn write(&self, document: &CredentialDocument) -> Result<()>
Sourcepub fn write_locked(
&self,
lock: &CredentialLock,
document: &CredentialDocument,
) -> Result<()>
pub fn write_locked( &self, lock: &CredentialLock, document: &CredentialDocument, ) -> Result<()>
Replace a document while the caller holds this store’s exclusive lock. This is the seam used by the async refresh flow; it never performs an exchange after releasing the lock.
pub fn logout(&self) -> Result<()>
pub fn read_unlocked(&self) -> Result<Option<CredentialDocument>>
Trait Implementations§
Source§impl Clone for CredentialStore
impl Clone for CredentialStore
Source§impl Debug for CredentialStore
impl Debug for CredentialStore
Auto Trait Implementations§
impl !RefUnwindSafe for CredentialStore
impl !UnwindSafe for CredentialStore
impl Freeze for CredentialStore
impl Send for CredentialStore
impl Sync for CredentialStore
impl Unpin for CredentialStore
impl UnsafeUnpin for CredentialStore
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more