rmk 0.9.0

Keyboard firmware written in Rust
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
/// The trait for runnable input devices and processors.
///
/// For some input devices or processors, they should keep running in a separate task.
/// This trait is used to run them in a separate task.
pub trait Runnable {
    async fn run(&mut self) -> !;
}

impl<T: Runnable> Runnable for Option<T> {
    async fn run(&mut self) -> ! {
        match self {
            Some(runnable) => runnable.run().await,
            None => core::future::pending().await,
        }
    }
}