pub struct KeyringEntry {
pub key: String,
/* private fields */
}
Expand description
The representation of a keyring entry.
This struct is a simple wrapper around native::Entry
that
holds a keyring entry key.
Fields§
§key: String
The key used to identify the current keyring entry.
Implementations§
Source§impl KeyringEntry
impl KeyringEntry
Sourcepub async fn get_secret(&self) -> Result<String>
pub async fn get_secret(&self) -> Result<String>
Gets the secret of the keyring entry.
Sourcepub async fn find_secret(&self) -> Result<Option<String>>
pub async fn find_secret(&self) -> Result<Option<String>>
Finds the secret of the keyring entry.
This function is like KeyringEntry::get_secret
, except
that it returns None
in case the secret cannot be found.
Sourcepub async fn set_secret(&self, secret: impl ToString) -> Result<()>
pub async fn set_secret(&self, secret: impl ToString) -> Result<()>
(Re)sets the secret of the keyring entry.
Sourcepub async fn try_with_secret(self, secret: impl ToString) -> Result<Self>
pub async fn try_with_secret(self, secret: impl ToString) -> Result<Self>
(Re)sets the secret of the keyring entry, using the builder pattern.
This function acts like KeyringEntry::set_secret
, except
that it returns Self
instead of ()
.
Sourcepub async fn delete_secret(&self) -> Result<()>
pub async fn delete_secret(&self) -> Result<()>
Deletes the secret of the keyring entry.
Trait Implementations§
Source§impl Clone for KeyringEntry
impl Clone for KeyringEntry
Source§fn clone(&self) -> KeyringEntry
fn clone(&self) -> KeyringEntry
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for KeyringEntry
impl Debug for KeyringEntry
Source§impl<'de> Deserialize<'de> for KeyringEntry
impl<'de> Deserialize<'de> for KeyringEntry
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl From<KeyringEntry> for String
impl From<KeyringEntry> for String
Source§fn from(entry: KeyringEntry) -> Self
fn from(entry: KeyringEntry) -> Self
Returns the key of the current keyring entry.
Source§impl PartialEq for KeyringEntry
impl PartialEq for KeyringEntry
Source§impl Serialize for KeyringEntry
impl Serialize for KeyringEntry
Source§impl TryFrom<String> for KeyringEntry
impl TryFrom<String> for KeyringEntry
impl Eq for KeyringEntry
Auto Trait Implementations§
impl Freeze for KeyringEntry
impl !RefUnwindSafe for KeyringEntry
impl Send for KeyringEntry
impl Sync for KeyringEntry
impl Unpin for KeyringEntry
impl !UnwindSafe for KeyringEntry
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