pub struct OsKeyringSecretStore { /* private fields */ }Expand description
SecretStore impl backed by the platform’s native credential store.
Each variable’s value is stored as a single credential keyed by the variable’s UUID. See the crate-level docs for the per-platform mapping.
§Examples
use evault_store_keyring::OsKeyringSecretStore;
let store = OsKeyringSecretStore::new().expect("init keyring");Implementations§
Source§impl OsKeyringSecretStore
impl OsKeyringSecretStore
Sourcepub fn new() -> Result<Self, SecretError>
pub fn new() -> Result<Self, SecretError>
Construct a store using the canonical "evault" service identifier.
Initializes the platform-native backend on first call; subsequent calls re-use the same backend.
§Errors
Returns SecretError::Unavailable if the platform offers no usable
secret store (e.g. headless Linux without D-Bus). Returns
SecretError::Backend for other initialisation failures.
Sourcepub fn with_service(service: impl Into<String>) -> Result<Self, SecretError>
pub fn with_service(service: impl Into<String>) -> Result<Self, SecretError>
Construct a store using a caller-supplied service identifier. Useful for tests that need to isolate from any production data.
§Errors
Returns SecretError::Backend with label "empty_service" if
the service identifier is empty (platform behaviour for the empty
case is inconsistent — Windows DPAPI accepts it, Linux Secret
Service may reject it, macOS Keychain may silently accept). The
remaining error cases are the same as Self::new.
Trait Implementations§
Source§impl Debug for OsKeyringSecretStore
impl Debug for OsKeyringSecretStore
Source§impl SecretStore for OsKeyringSecretStore
impl SecretStore for OsKeyringSecretStore
Source§fn put(&self, id: VarId, value: SecretString) -> Result<(), SecretError>
fn put(&self, id: VarId, value: SecretString) -> Result<(), SecretError>
Source§fn get(&self, id: VarId) -> Result<Option<SecretString>, SecretError>
fn get(&self, id: VarId) -> Result<Option<SecretString>, SecretError>
Auto Trait Implementations§
impl Freeze for OsKeyringSecretStore
impl RefUnwindSafe for OsKeyringSecretStore
impl Send for OsKeyringSecretStore
impl Sync for OsKeyringSecretStore
impl Unpin for OsKeyringSecretStore
impl UnsafeUnpin for OsKeyringSecretStore
impl UnwindSafe for OsKeyringSecretStore
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
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSend for T
impl<T> DowncastSend for T
Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
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>
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>
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