mod count_rhythm;
mod event_trigger;
mod iterator;
pub mod replay;
mod sys_timer;
use std::fmt::Debug;
use std::future::Future;
pub use count_rhythm::*;
pub use event_trigger::*;
pub use iterator::*;
pub use sys_timer::*;
use crate::RoplatError;
pub trait Rhythm {
type Yield: Send;
type Feed;
type Output;
type Error: Into<RoplatError> + Debug;
fn drive<N, F, Fut>(
&mut self,
nodes: N,
op_domain: F,
) -> impl Future<Output = (Self::Output, N)> + Send
where
N: Send,
F: FnMut(N, Self::Yield) -> Fut + Send,
Fut: Future<Output = (Self::Feed, N)> + Send;
fn init<N, F>(
&mut self,
_nodes: N,
_init: F,
) -> impl Future<Output = Result<(), Self::Error>> + Send
where
N: Send,
F: FnMut() + Send,
{
async { Ok(()) }
}
fn shutdown<N, F>(
&mut self,
_nodes: N,
_shutdown: F,
) -> impl Future<Output = Result<(), Self::Error>> + Send
where
N: Send,
F: for<'a> FnMut(&'a mut N) + Send,
{
async { Ok(()) }
}
}