Skip to main content

Keyring

Trait Keyring 

Source
pub trait Keyring {
    // Required methods
    fn set_value(&mut self, value: &str) -> Result<()>;
    fn get_value(&self) -> Result<String>;
    fn delete_value(&mut self) -> Result<()>;
}
Expand description

A single keyring entry, bound to one (application, service, key) triple.

A backend reports KeyringError::NoPasswordFound only when it established that nothing is stored. On iOS a store that could not be read reports KeyringError::Locked instead, so a caller may treat absence as an invitation to write.

Required Methods§

Source

fn set_value(&mut self, value: &str) -> Result<()>

Store a value, overwriting any existing one. Never reports absence.

Source

fn get_value(&self) -> Result<String>

Read the stored value, or KeyringError::NoPasswordFound if absent.

Source

fn delete_value(&mut self) -> Result<()>

Delete the stored value, or KeyringError::NoPasswordFound if absent.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§