pub struct KeyringBackend;Expand description
Wraps the [keyring] crate to store one entry per profile.
Service name is fixed at "brows3r". The per-entry credential name is
"profile:<profile_id>".
Secrets are serialized as StoredSecret JSON before storage; the
keyring crate treats its value as an opaque password string, so JSON is
the simplest portable encoding.
Implementations§
Trait Implementations§
Source§impl Default for KeyringBackend
impl Default for KeyringBackend
Source§impl KeychainBackend for KeyringBackend
impl KeychainBackend for KeyringBackend
Source§fn set(&mut self, profile_id: &str, secret: &Secret) -> Result<(), AppError>
fn set(&mut self, profile_id: &str, secret: &Secret) -> Result<(), AppError>
Persist
secret under profile_id, replacing any existing entry.Source§fn get(&self, profile_id: &str) -> Result<Option<Secret>, AppError>
fn get(&self, profile_id: &str) -> Result<Option<Secret>, AppError>
Retrieve the secret for
profile_id, or None if not present.Auto Trait Implementations§
impl Freeze for KeyringBackend
impl RefUnwindSafe for KeyringBackend
impl Send for KeyringBackend
impl Sync for KeyringBackend
impl Unpin for KeyringBackend
impl UnsafeUnpin for KeyringBackend
impl UnwindSafe for KeyringBackend
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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 moreCreates a shared type from an unshared type.
§impl<T> NoneValue for Twhere
T: Default,
impl<T> NoneValue for Twhere
T: Default,
type NoneType = T
§fn null_value() -> T
fn null_value() -> T
The none-equivalent value.