pub enum Behavior<I, O> {
Function {
clone: fn(_: &I) -> I,
call: Box<dyn FnMut(I) -> O + Send + 'static>,
},
Const(Mutex<Box<dyn Iterator<Item = O> + Send + 'static>>),
Once(Mutex<Option<O>>),
CallsRealImpl,
}
Expand description
Behavior of mock
Variants§
Function
Behaves with a function
Const(Mutex<Box<dyn Iterator<Item = O> + Send + 'static>>)
Returns a constant value
Once(Mutex<Option<O>>)
Once
CallsRealImpl
Calls real implementation instead of mock
Trait Implementations§
Auto Trait Implementations§
impl<I, O> !RefUnwindSafe for Behavior<I, O>
impl<I, O> Send for Behavior<I, O>where
O: Send,
impl<I, O> !Sync for Behavior<I, O>
impl<I, O> Unpin for Behavior<I, O>where
O: Unpin,
impl<I, O> !UnwindSafe for Behavior<I, O>
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