pub struct DefaultKeyringStore { /* private fields */ }Expand description
OS-native keyring backend.
Wraps the platform credential store:
- macOS: Keychain (via
securityframework) - Windows: Credential Manager
- Linux: Secret Service (GNOME Keyring / kwallet via dbus), excluding OHOS
This backend is opt-in – set the SECRET_BACKEND_ENV environment
variable to system or keyring to activate it. On platforms without
a configured native keyring dependency, probe
returns an unsupported error so Secrets::auto_detect can transparently
fall back to FileKeyringStore.
Implementations§
Source§impl DefaultKeyringStore
impl DefaultKeyringStore
Sourcepub fn probe(&self) -> Result<(), SecretsError>
pub fn probe(&self) -> Result<(), SecretsError>
Probe the OS keyring without writing anything. Returns Ok(()) if
a backend is reachable, otherwise an error describing why not.
The probe reads a deliberately-nonexistent entry: reaching the
backend and learning the entry is absent is the reachability
signal. This does not prompt on any supported platform — macOS only
surfaces Keychain UI when accessing an existing item owned by
another application, and Windows Credential Manager never prompts
for a missing target — so __probe__ under our own service name is
safe to read. Entry::new alone validates only argument shapes,
which left this probe a no-op on macOS/Windows and the documented
file-store fallback unreachable there (#5172).
Trait Implementations§
Source§impl Clone for DefaultKeyringStore
impl Clone for DefaultKeyringStore
Source§fn clone(&self) -> DefaultKeyringStore
fn clone(&self) -> DefaultKeyringStore
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more