Skip to main content

State

Trait State 

Source
pub trait State {
    type Id: Hash + Clone + Eq;

    // Required methods
    fn id(&self) -> &Self::Id;
    fn trigger(self);
}
Expand description

A trait for state that can be triggered once.

Required Associated Types§

Source

type Id: Hash + Clone + Eq

The type of the unique id of the outstanding timeout.

Required Methods§

Source

fn id(&self) -> &Self::Id

A reference to the id associated with this state.

Source

fn trigger(self)

Trigger is called by the timer implementation when the timeout has expired.

Implementors§

Source§

impl<I> State for ClosureState<I>
where I: Hash + Clone + Eq,

Source§

type Id = I