Struct keyring::Entry

source ·
pub struct Entry { /* private fields */ }

Implementations§

source§

impl Entry

Create an entry for the given service and username. This maps to a target credential in the default keychain.

This call never fails, because there is no actual platform access performed when the credential object is created. But if you specify empty strings for any of the arguments, any attempt to use the credential will fail with a NoEntry error. And if you specify a string that exceeds platform limits, you will get a TooLong error.

Create an entry for the given target, service, and username. On Linux and Mac, the target is interpreted as naming the collection/keychain to store the credential. On Windows, the target is used directly as the target name of the credential.

This call never fails, because there is no actual platform access performed when the credential object is created. But if you specify empty strings for any of the arguments, any attempt to use the credential will fail with a NoEntry error. And if you specify a string that exceeds platform limits, you will get a TooLong error.

Create an entry that uses the given credential for storage. Callers can use their own algorithm to produce a platform-specific credential spec for the given service and username and then call this entry with that value.

This call never fails, because there is no actual platform access performed when the credential object is created. But if you specify a platform credential that contains empty or invalid attributes, you may get errors or surprises when attempting to use the credential.

Set the password for this entry. Any other platform-specific annotations are determined by the mapper that was used to create the credential.

Retrieve the password saved for this entry. Returns a NoEntry error is there isn’t one.

Retrieve the password and all the other fields set in the platform-specific credential. This allows retrieving metadata on the credential that were saved by external applications.

Delete the password for this entry. (Although the entry itself follows the Rust structure lifecycle, deleting the password deletes the platform credential from secure storage.)

Trait Implementations§

source§

impl Debug for Entry

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl RefUnwindSafe for Entry

§

impl Send for Entry

§

impl Sync for Entry

§

impl Unpin for Entry

§

impl UnwindSafe for Entry

Blanket Implementations§

source§

impl<T> Any for Twhere
    T: 'static + ?Sized,

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere
    T: ?Sized,

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere
    T: ?Sized,

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere
    U: From<T>,

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for Twhere
    U: Into<T>,

The type returned in the event of a conversion error.
Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere
    U: TryFrom<T>,

The type returned in the event of a conversion error.
Performs the conversion.