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
use crate::{State, testing::TestContext};

pub(crate) struct DispatchOnDrop<'c, 'a, S: State<Event: Copy>>(
    pub(crate) &'c TestContext<'a, S>,
    pub(crate) S::Event,
);

impl<S: State<Event: Copy>> Drop for DispatchOnDrop<'_, '_, S> {
    fn drop(&mut self) {
        self.0.dispatch(self.1);
    }
}