struct BackendBox(Box<dyn KeychainBackend + Send + Sync>);Expand description
Thin wrapper so Box<dyn KeychainBackend + Send + Sync> can be stored
inside Arc<Mutex<dyn KeychainBackend + ...>>.
select_backend returns a Box<dyn KeychainBackend> (not + Send + Sync
in older call sites) so we bridge the gap here.
Tuple Fields§
§0: Box<dyn KeychainBackend + Send + Sync>Trait Implementations§
Source§impl KeychainBackend for BackendBox
impl KeychainBackend for BackendBox
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 BackendBox
impl !RefUnwindSafe for BackendBox
impl Send for BackendBox
impl Sync for BackendBox
impl Unpin for BackendBox
impl UnsafeUnpin for BackendBox
impl !UnwindSafe for BackendBox
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.