pub struct FunnyBot<'a, A, R>{ /* private fields */ }Implementations§
Source§impl<'a, A, R> FunnyBot<'a, A, R>
impl<'a, A, R> FunnyBot<'a, A, R>
pub fn new(returns: Box<dyn Iterator<Item = R> + Send + Sync + 'a>) -> Self
Sourcepub fn from_single(returns: R) -> Self
pub fn from_single(returns: R) -> Self
initialize Funnybot with a single return value. consequently calling more than once will panic
Sourcepub fn from_list(returns: Vec<R>) -> Self
pub fn from_list(returns: Vec<R>) -> Self
initialize Funnybot with a fixed list of return values. once the all values have returned, the function will panic
Sourcepub fn repeat_with<F: 'a + Sync + Send + FnMut() -> R>(repeater: F) -> Self
pub fn repeat_with<F: 'a + Sync + Send + FnMut() -> R>(repeater: F) -> Self
initialize Funnybot with a repeater-function that generates values for each call
Sourcepub fn call(&self, a: A) -> R
pub fn call(&self, a: A) -> R
simulate a call
pass the arguments to record as a
returns the next value from the iterator as pre-programmed
Sourcepub fn args(&self) -> RwLockReadGuard<'_, Vec<A>>
pub fn args(&self) -> RwLockReadGuard<'_, Vec<A>>
return a current snapshot of the recorded arguments
Auto Trait Implementations§
impl<'a, A, R> !Freeze for FunnyBot<'a, A, R>
impl<'a, A, R> RefUnwindSafe for FunnyBot<'a, A, R>
impl<'a, A, R> Send for FunnyBot<'a, A, R>
impl<'a, A, R> Sync for FunnyBot<'a, A, R>
impl<'a, A, R> Unpin for FunnyBot<'a, A, R>where
A: Unpin,
impl<'a, A, R> UnwindSafe for FunnyBot<'a, A, R>
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