[][src]Struct mockiato::MethodCallBuilder

pub struct MethodCallBuilder<'mock, 'a, A, R> where
    A: for<'args> ArgumentsMatcher<'args>, 
{ /* fields omitted */ }

Configures an expected method call. This builder is returned from the expect_* methods on a generated mock.

Methods

impl<'mock, 'a, A, R> MethodCallBuilder<'mock, 'a, A, R> where
    A: for<'args> ArgumentsMatcher<'args>, 
[src]

pub fn returns(&mut self, return_value: R) -> &mut Self where
    R: Clone + 'mock, 
[src]

Defines the return value for this method. The value must be Cloneable.

This method does not need to be called on nightly for the unit type ().

pub fn returns_once(&mut self, return_value: R) -> &mut Self where
    R: 'mock, 
[src]

Defines a return value for this method that will be returned once. The mocked method will panic on subsequent calls.

This method does not need to be called on nightly for the unit type ().

pub fn panics(&mut self) -> &mut Self[src]

Defines that this method panics.

pub fn panics_with_message(&mut self, message: &'static str) -> &mut Self[src]

Defines that this method panics with a message.

pub fn times<E>(&mut self, expected_calls: E) -> &mut Self where
    E: Into<ExpectedCalls>, 
[src]

Defines how often this method should be called.

Accepted values

Description Type Example
Exact amount of times u64 3
Any amount of times RangeFull ..
At least RangeFrom 3..
At most (exclusive) RangeTo ..3
At most (inclusive) RangeToInclusive ..=3
Between (exclusive) Range 3..4
Between (inclusive) RangeInclusive 3..=4

Trait Implementations

impl<'mock, 'a, A, R> Debug for MethodCallBuilder<'mock, 'a, A, R> where
    A: for<'args> ArgumentsMatcher<'args>, 
[src]

Auto Trait Implementations

impl<'mock, 'a, A, R> !Send for MethodCallBuilder<'mock, 'a, A, R>

impl<'mock, 'a, A, R> !Sync for MethodCallBuilder<'mock, 'a, A, R>

Blanket Implementations

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]