Trait BehaviourFunction

Source
pub trait BehaviourFunction<E: ErrorType>: for<'a> FnOnce(&'a mut InSender<E>, &'a mut OutReceiver) -> Pin<Box<dyn Future<Output = ()> + Send + 'a>> + Send { }
Expand description

A BehaviourFunction can send messages to the provided sender and check responses on the provided receiver, thereby testing expected behaviour. It returns the channels it received as inputs in order to faciliate further checks downstream, and enable chaining.

DOes A blanket implementation for any Function with the appropriate Signature is provided.

Implementors§

Source§

impl<E: ErrorType, T> BehaviourFunction<E> for T
where for<'a> T: FnOnce(&'a mut InSender<E>, &'a mut OutReceiver) -> Pin<Box<dyn Future<Output = ()> + Send + 'a>> + Send,