[−][src]Struct spy::SpySnapshot
The structure represents a snapshot of a spy object. Taken snapshot
contains all the calls starting from the moment when Spy
object was created
or previous snapshot if there was taken one.
Generic type Args
is in fact a tuple that describes argument values for each
call.
Methods
impl<Args: PartialEq> SpySnapshot<Args>
[src]
pub fn called(&self) -> bool
[src]
It returns true
if spy function was called at least once and false
otherwise.
pub fn called_with(&self, args: Args) -> bool
[src]
It returns true
if spy function was called at least once
with provided arguments and false
otherwise.
pub fn each_called_with(&self, args: Args) -> bool
[src]
It returns true
if spy function was called with provided arguments each time
it was called.
pub fn num_of_calls(&self) -> usize
[src]
It returns how many times spy function was called.
pub fn all_calls(&self) -> &Vec<Args>
[src]
It returns a vector that contains all calls arguments.
pub fn first_call(&self) -> Option<&Args>
[src]
It returns first call arguments. None
will be returned if spy function was not
called till the moment when a snapshot was taken.
pub fn last_call(&self) -> Option<&Args>
[src]
It returns last call arguments. None
will be returned if spy function was not
called till the moment when a snapshot was taken.
pub fn nth_call(&self, n: usize) -> Option<&Args>
[src]
It returns n-th call arguments. None
will be returned if spy function was not
called enough times till the moment when a snapshot was taken.
Auto Trait Implementations
impl<Args> Unpin for SpySnapshot<Args> where
Args: Unpin,
Args: Unpin,
impl<Args> Send for SpySnapshot<Args> where
Args: Send,
Args: Send,
impl<Args> Sync for SpySnapshot<Args> where
Args: Sync,
Args: Sync,
impl<Args> UnwindSafe for SpySnapshot<Args> where
Args: UnwindSafe,
Args: UnwindSafe,
impl<Args> RefUnwindSafe for SpySnapshot<Args> where
Args: RefUnwindSafe,
Args: RefUnwindSafe,
Blanket Implementations
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,