[−][src]Struct mockiato::MethodCallBuilder
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]
A: for<'args> ArgumentsMatcher<'args>,
pub fn returns(&mut self, return_value: R) -> &mut Self where
R: Clone + 'mock,
[src]
R: Clone + 'mock,
Defines the return value for this method.
The value must be Clone
able.
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]
R: 'mock,
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]
E: Into<ExpectedCalls>,
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]
A: for<'args> ArgumentsMatcher<'args>,
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,
'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]
U: From<T>,
impl<T> From<T> for T
[src]
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> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,