Waiter

Trait Waiter 

Source
pub trait Waiter: WaiterClone + Send {
    // Required method
    fn wait(&self) -> Result<(), WaiterError>;

    // Provided methods
    fn restart(&mut self) -> Result<(), WaiterError> { ... }
    fn start(&mut self) { ... }
}
Expand description

A waiter trait, that can be used for executing a delay. Waiters need to be multi-threaded and cloneable. A waiter should not be reused twice.

Required Methods§

Source

fn wait(&self) -> Result<(), WaiterError>

Called at each cycle of the waiting cycle. Call after starting the waiter otherwise returns an error.

Provided Methods§

Source

fn restart(&mut self) -> Result<(), WaiterError>

Restart the wait timer. Call after starting the waiter otherwise returns an error.

Source

fn start(&mut self)

Called when we start the waiting cycle.

Trait Implementations§

Source§

impl Clone for Box<dyn Waiter>

Finally, a Box of Waiter implements clone by calling the WaiterClone::clone_box method.

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more

Implementors§