pub struct Expectation { /* private fields */ }Expand description
Expectation type for methods taking a &self argument and
returning immutable references. This is the type returned by
the expect_* methods.
Implementations§
Source§impl Expectation
impl Expectation
Sourcepub fn call(&self) -> &Extent
pub fn call(&self) -> &Extent
Call this Expectation as if it were the real method.
Sourcepub fn return_const(&mut self, __mockall_o: Extent) -> &mut Self
pub fn return_const(&mut self, __mockall_o: Extent) -> &mut Self
Return a reference to a constant value from the Expectation
Sourcepub fn in_sequence(&mut self, __mockall_seq: &mut Sequence) -> &mut Self
pub fn in_sequence(&mut self, __mockall_seq: &mut Sequence) -> &mut Self
Add this expectation to a
Sequence.
Sourcepub fn new() -> Self
pub fn new() -> Self
Create a new, default, Expectation
Sourcepub fn once(&mut self) -> &mut Self
pub fn once(&mut self) -> &mut Self
Expect this expectation to be called exactly once. Shortcut for
times(1).
Sourcepub fn times<MockallR>(&mut self, __mockall_r: MockallR) -> &mut Selfwhere
MockallR: Into<TimesRange>,
pub fn times<MockallR>(&mut self, __mockall_r: MockallR) -> &mut Selfwhere
MockallR: Into<TimesRange>,
Restrict the number of times that that this method may be called.
The argument may be:
- A fixed number:
.times(4) - Various types of range:
.times(5..10).times(..10).times(5..).times(5..=10).times(..=10)
- The wildcard:
.times(..)
Sourcepub fn with(&mut self) -> &mut Self
pub fn with(&mut self) -> &mut Self
Set matching criteria for this Expectation.
The matching predicate can be anything implemening the
Predicate trait. Only
one matcher can be set per Expectation at a time.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for Expectation
impl RefUnwindSafe for Expectation
impl Send for Expectation
impl Sync for Expectation
impl Unpin for Expectation
impl UnwindSafe for Expectation
Blanket Implementations§
§impl<T> AnySync for T
impl<T> AnySync for T
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
§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
Source§impl<A, M> Handler<IndexedErasedUnbound<M>> for A
impl<A, M> Handler<IndexedErasedUnbound<M>> for A
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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§impl<T> NoneValue for Twhere
T: Default,
impl<T> NoneValue for Twhere
T: Default,
type NoneType = T
§fn null_value() -> T
fn null_value() -> T
The none-equivalent value.