[][src]Struct funnybot::FunnyBot

pub struct FunnyBot<'a, A, R> where
    A: Send + Sync + Clone,
    R: Send + Sync + 'a, 
{ /* fields omitted */ }

Implementations

impl<'a, A, R> FunnyBot<'a, A, R> where
    A: Send + Sync + Clone,
    R: Send + Sync + 'a + Clone
[src]

pub fn repeat(elt: R) -> Self[src]

initialize Funnybot with a fixed value that will be repeated for each call

impl<'a, A, R> FunnyBot<'a, A, R> where
    A: Send + Sync + Clone,
    R: Send + Sync + 'a, 
[src]

#[must_use]pub fn new(returns: Box<dyn Iterator<Item = R> + Send + Sync + 'a>) -> Self[src]

#[must_use]pub fn from_single(returns: R) -> Self[src]

initialize Funnybot with a single return value. consequently calling more than once will panic

#[must_use]pub fn from_list(returns: Vec<R>) -> Self[src]

initialize Funnybot with a fixed list of return values. once the all values have returned, the function will panic

pub fn repeat_with<F: 'a + Sync + Send + FnMut() -> R>(repeater: F) -> Self[src]

initialize Funnybot with a repeater-function that generates values for each call

pub fn call(&self, a: A) -> R[src]

simulate a call

pass the arguments to record as a

returns the next value from the iterator as pre-programmed

pub fn into_args(self) -> Vec<A>[src]

return the recorded arguments. This consumes the Funnybot

pub fn args(&self) -> RwLockReadGuard<Vec<A>>[src]

return a current snapshot of the recorded arguments

Auto Trait Implementations

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

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.