Struct keyring::native::mock::MockCredential
source · pub struct MockCredential {
pub inner: Mutex<RefCell<MockData>>,
}Expand description
The concrete mock credential
Mocks use an internal mutability pattern since entries are read-only. The mutex is used to make sure these are Sync.
Fields§
§inner: Mutex<RefCell<MockData>>Implementations§
Trait Implementations§
source§impl CredentialApi for MockCredential
impl CredentialApi for MockCredential
source§fn set_password(&self, password: &str) -> Result<(), Error>
fn set_password(&self, password: &str) -> Result<(), Error>
Set a password on a mock credential.
If there is an error in the mock, it will be returned and the password will not be set. The error will be cleared, so calling again will set the password.
source§fn get_password(&self) -> Result<String, Error>
fn get_password(&self) -> Result<String, Error>
Get the password from a mock credential, if any.
If there is an error set in the mock, it will be returned instead of a password.
source§impl Debug for MockCredential
impl Debug for MockCredential
source§impl Default for MockCredential
impl Default for MockCredential
source§fn default() -> MockCredential
fn default() -> MockCredential
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl RefUnwindSafe for MockCredential
impl Send for MockCredential
impl Sync for MockCredential
impl Unpin for MockCredential
impl UnwindSafe for MockCredential
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
§impl<T> NoneValue for Twhere
T: Default,
impl<T> NoneValue for Twhere
T: Default,
type NoneType = T
§fn null_value() -> T
fn null_value() -> T
The none-equivalent value.