realtime_core/lib.rs
1use core::time::Duration;
2
3#[derive(Debug)]
4pub enum ErrorKind {
5 NotRoot,
6 NotStart,
7 Unknown(isize),
8}
9pub type Result<T> = core::result::Result<T, ErrorKind>;
10
11pub trait RealTime {
12 /// Start a periodic real-time task.
13 fn start(&mut self, period: Duration) -> Result<()>;
14 /// Stop a periodic real-time task.
15 fn stop(&mut self) -> Result<()>;
16 /// Delay the current task until the next periodic release point is reached.
17 fn wait_period(&mut self) -> Result<()>;
18}