Store

Struct Store 

Source
pub struct Store {
    pub id: String,
    pub inner: Mutex<RefCell<Vec<Arc<Cred>>>>,
}
Expand description

The builder for mock credentials.

We keep them in a vector so we can reuse them for entries with the same service and user. Yes, a hashmap might be faster, but this is way simpler.

Fields§

§id: String§inner: Mutex<RefCell<Vec<Arc<Cred>>>>

Implementations§

Source§

impl Store

Source

pub fn new() -> Result<Arc<Self>>

Trait Implementations§

Source§

impl CredentialStoreApi for Store

Source§

fn build( &self, service: &str, user: &str, mods: Option<&HashMap<&str, &str>>, ) -> Result<Entry>

Build a mock credential for the service and user. No modifiers are allowed.

Since mocks don’t persist beyond the life of their entry, all mocks start off without passwords.

Source§

fn search(&self, spec: &HashMap<&str, &str>) -> Result<Vec<Entry>>

Search for mock credentials matching the spec.

Attributes other than service and user are ignored. Their values are used in unanchored substring searches against the specifier.

Source§

fn as_any(&self) -> &dyn Any

Get an Any reference to the mock credential builder.

Source§

fn persistence(&self) -> CredentialPersistence

This keystore keeps the password in the entry!

Source§

fn debug_fmt(&self, f: &mut Formatter<'_>) -> Result

Expose the concrete debug formatter for use via the CredentialStore trait

Source§

fn vendor(&self) -> String

The name of the “vendor” that provides this store. Read more
Source§

fn id(&self) -> String

The ID of this credential store instance. Read more
Source§

impl Debug for Store

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl !Freeze for Store

§

impl RefUnwindSafe for Store

§

impl Send for Store

§

impl Sync for Store

§

impl Unpin for Store

§

impl UnwindSafe for Store

Blanket Implementations§

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

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

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

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

Source§

fn into(self) -> U

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 T
where U: Into<T>,

Source§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

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

Source§

type Error = <U as TryFrom<T>>::Error

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

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.