pub struct MockRegistry { /* private fields */ }Expand description
Mock registry for tracking mocked functions
Implementations§
Source§impl MockRegistry
impl MockRegistry
pub fn new() -> Self
Sourcepub fn record_call(&mut self, function_name: &str)
pub fn record_call(&mut self, function_name: &str)
Record that a function was called
Sourcepub fn call_count(&self, function_name: &str) -> usize
pub fn call_count(&self, function_name: &str) -> usize
Get call count for a function
Sourcepub fn was_called(&self, function_name: &str) -> bool
pub fn was_called(&self, function_name: &str) -> bool
Was function called?
Sourcepub fn verify_called_times(&self, function_name: &str, expected_count: usize)
pub fn verify_called_times(&self, function_name: &str, expected_count: usize)
Verify function was called exactly N times
Trait Implementations§
Source§impl Debug for MockRegistry
impl Debug for MockRegistry
Source§impl Default for MockRegistry
impl Default for MockRegistry
Source§fn default() -> MockRegistry
fn default() -> MockRegistry
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for MockRegistry
impl RefUnwindSafe for MockRegistry
impl Send for MockRegistry
impl Sync for MockRegistry
impl Unpin for MockRegistry
impl UnsafeUnpin for MockRegistry
impl UnwindSafe for MockRegistry
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