pub struct Keychain;Available on macOS and crate feature
full only.Expand description
Wraps generic-password operations built on SecItem APIs.
Implementations§
Source§impl Keychain
impl Keychain
Sourcepub fn entry(
account: impl Into<String>,
service: impl Into<String>,
) -> KeychainEntry
pub fn entry( account: impl Into<String>, service: impl Into<String>, ) -> KeychainEntry
Wraps the corresponding generic-password SecItem operation.
Sourcepub fn set(account: &str, service: &str, secret: impl AsRef<[u8]>) -> Result<()>
pub fn set(account: &str, service: &str, secret: impl AsRef<[u8]>) -> Result<()>
Wraps the corresponding generic-password SecItem operation.
Sourcepub fn get(account: &str, service: &str) -> Result<SecretBytes>
pub fn get(account: &str, service: &str) -> Result<SecretBytes>
Wraps the corresponding generic-password SecItem operation.
Sourcepub fn delete(account: &str, service: &str) -> Result<()>
pub fn delete(account: &str, service: &str) -> Result<()>
Wraps the corresponding generic-password SecItem operation.
Sourcepub fn list_accounts(service: &str) -> Result<Vec<String>>
pub fn list_accounts(service: &str) -> Result<Vec<String>>
Wraps the corresponding generic-password SecItem operation.
pub fn set_with_options( account: &str, service: &str, secret: impl AsRef<[u8]>, options: &KeychainOptions, ) -> Result<()>
pub fn get_with_options( account: &str, service: &str, options: &KeychainOptions, ) -> Result<SecretBytes>
pub fn delete_with_options( account: &str, service: &str, options: &KeychainOptions, ) -> Result<()>
pub fn list_accounts_with_options( service: &str, options: &KeychainOptions, ) -> Result<Vec<String>>
Auto Trait Implementations§
impl Freeze for Keychain
impl RefUnwindSafe for Keychain
impl Send for Keychain
impl Sync for Keychain
impl Unpin for Keychain
impl UnsafeUnpin for Keychain
impl UnwindSafe for Keychain
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