Trait keyring::credential::CredentialApi
source · pub trait CredentialApi {
// Required methods
fn set_password(&self, password: &str) -> Result<()>;
fn get_password(&self) -> Result<String>;
fn delete_password(&self) -> Result<()>;
fn as_any(&self) -> &dyn Any;
}
Expand description
The API that credentials implement.
Required Methods§
sourcefn set_password(&self, password: &str) -> Result<()>
fn set_password(&self, password: &str) -> Result<()>
Set the credential’s password.
This will persist the password in the underlying store.
sourcefn get_password(&self) -> Result<String>
fn get_password(&self) -> Result<String>
Retrieve a password from the credential, if one has been set.
This has no effect on the underlying store.
sourcefn delete_password(&self) -> Result<()>
fn delete_password(&self) -> Result<()>
Forget the credential’s password, if one has been set.
This will also remove the credential from the underlying store, so a second call to delete_password will return a NoEntry error.