pub struct ExpectBehaviour {
pub stmt_id: usize,
pub bound: Rc<dyn Any>,
/* private fields */
}Expand description
Stores the state of a expected behaviour.
Fields§
§stmt_id: usizeThe unique id of the behaviour within the mocked method to which it belongs.
bound: Rc<dyn Any>The bound variables available to the behaviour’s ArgMatcher.
Implementations§
Source§impl ExpectBehaviour
impl ExpectBehaviour
Sourcepub fn with_times(
times: usize,
stmt_id: usize,
bound: Rc<dyn Any>,
stmt_repr: &str,
) -> Self
pub fn with_times( times: usize, stmt_id: usize, bound: Rc<dyn Any>, stmt_repr: &str, ) -> Self
Creates a new behaviour which is satisfied if matched times.
Sourcepub fn with_at_least(
at_least_times: usize,
stmt_id: usize,
bound: Rc<dyn Any>,
stmt_repr: &str,
) -> Self
pub fn with_at_least( at_least_times: usize, stmt_id: usize, bound: Rc<dyn Any>, stmt_repr: &str, ) -> Self
Creates a new behaviour which is satisfied if matched at_least_times.
Sourcepub fn with_at_most(
at_most_times: usize,
stmt_id: usize,
bound: Rc<dyn Any>,
stmt_repr: &str,
) -> Self
pub fn with_at_most( at_most_times: usize, stmt_id: usize, bound: Rc<dyn Any>, stmt_repr: &str, ) -> Self
Creates a new behaviour which is satisfied if matched at_most_times.
Sourcepub fn with_between(
at_least_times: usize,
at_most_times: usize,
stmt_id: usize,
bound: Rc<dyn Any>,
stmt_repr: &str,
) -> Self
pub fn with_between( at_least_times: usize, at_most_times: usize, stmt_id: usize, bound: Rc<dyn Any>, stmt_repr: &str, ) -> Self
Creates a new behaviour which is satisfied if matched between [at_least_times, at_most_times] (inclusive endpoints).
Sourcepub fn is_saturated(&self) -> bool
pub fn is_saturated(&self) -> bool
Returns true iff current number of matches would satify the behaviours expected repetitions.
Auto Trait Implementations§
impl !Freeze for ExpectBehaviour
impl !RefUnwindSafe for ExpectBehaviour
impl !Send for ExpectBehaviour
impl !Sync for ExpectBehaviour
impl !UnwindSafe for ExpectBehaviour
impl Unpin for ExpectBehaviour
impl UnsafeUnpin for ExpectBehaviour
Blanket Implementations§
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