pub struct CredentialStore { /* private fields */ }Expand description
Credential store abstraction
Implementations§
Source§impl CredentialStore
impl CredentialStore
Sourcepub fn store_credential(&self, key: &str, value: &str) -> Result<String>
pub fn store_credential(&self, key: &str, value: &str) -> Result<String>
Store a credential value
Sourcepub fn get_credential(
&self,
value: &str,
env_var: Option<&str>,
) -> Result<String>
pub fn get_credential( &self, value: &str, env_var: Option<&str>, ) -> Result<String>
Retrieve a credential value
Resolution order:
- Check environment variable (if env_var provided)
- If value starts with “keyring:”, retrieve from keyring
- Otherwise, return the value as-is (plaintext)
Sourcepub fn delete_credential(&self, key: &str) -> Result<()>
pub fn delete_credential(&self, key: &str) -> Result<()>
Delete a credential from storage
Sourcepub fn is_keyring_reference(value: &str) -> bool
pub fn is_keyring_reference(value: &str) -> bool
Check if a value is a keyring reference
Sourcepub fn storage_backend(&self) -> &str
pub fn storage_backend(&self) -> &str
Get the current storage backend
Trait Implementations§
Auto Trait Implementations§
impl Freeze for CredentialStore
impl RefUnwindSafe for CredentialStore
impl Send for CredentialStore
impl Sync for CredentialStore
impl Unpin for CredentialStore
impl UnwindSafe 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