externally-driven-async-rt 0.1.0

Async runtime that is meant to be embedded
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
/// A trait that your custom state must implement.
pub trait State: 'static {
    /// An event type.
    type Event;

    /// Your logic of event handling.
    ///
    /// Internally called when you call [`Context::dispatch`](crate::Context::dispatch).
    fn apply(&mut self, event: Self::Event);
}

impl State for () {
    type Event = ();

    fn apply(&mut self, _: Self::Event) {}
}