[][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

DescriptionTypeExample
Exact amount of timesu643
Any amount of timesRangeFull..
At leastRangeFrom3..
At most (exclusive)RangeTo..3
At most (inclusive)RangeToInclusive..=3
Between (exclusive)Range3..4
Between (inclusive)RangeInclusive3..=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>

impl<'mock, 'a, A, R> Unpin for MethodCallBuilder<'mock, 'a, A, R> where
    'mock: 'a, 

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

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

Blanket Implementations

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

impl<T> From<T> for 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> Borrow<T> for T where
    T: ?Sized
[src]

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

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