pub struct MockSignatureVerifier {
pub should_succeed: bool,
pub calls: Mutex<Vec<MockVerifyCall>>,
}Expand description
Mock signature verifier that always succeeds or fails based on configuration.
Constructed with MockSignatureVerifier::succeeding or
MockSignatureVerifier::failing. All calls to verify are recorded and can be
retrieved with MockSignatureVerifier::get_calls.
Fields§
§should_succeed: boolWhether verify should return Ok(true) or Ok(false).
calls: Mutex<Vec<MockVerifyCall>>Ordered record of every verify invocation made against this mock.
Implementations§
Source§impl MockSignatureVerifier
impl MockSignatureVerifier
Sourcepub fn succeeding() -> Self
pub fn succeeding() -> Self
Create a verifier that returns Ok(true) for every call to verify.
Sourcepub fn get_calls(&self) -> Vec<MockVerifyCall>
pub fn get_calls(&self) -> Vec<MockVerifyCall>
Return a snapshot of all verify calls recorded so far.
§Panics
Panics if the internal mutex is poisoned (a prior panic occurred while the lock was held).
Trait Implementations§
Source§impl SignatureVerifier for MockSignatureVerifier
impl SignatureVerifier for MockSignatureVerifier
Auto Trait Implementations§
impl !Freeze for MockSignatureVerifier
impl RefUnwindSafe for MockSignatureVerifier
impl Send for MockSignatureVerifier
impl Sync for MockSignatureVerifier
impl Unpin for MockSignatureVerifier
impl UnsafeUnpin for MockSignatureVerifier
impl UnwindSafe for MockSignatureVerifier
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more