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§
Trait Implementations§
Source§impl CredentialStoreApi for Store
impl CredentialStoreApi for Store
Source§fn build(
&self,
service: &str,
user: &str,
mods: Option<&HashMap<&str, &str>>,
) -> Result<Entry>
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>>
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 persistence(&self) -> CredentialPersistence
fn persistence(&self) -> CredentialPersistence
This keystore keeps the password in the entry!
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> 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