use std::ops;
use dope_core::{driver::schedule, io};
use dope_runtime::executor;
use crate::app::dispatch;
mod call;
mod driven;
mod set;
mod timed;
pub use call::Call;
pub use driven::Driven;
pub use set::Set;
pub use timed::Timed;
pub trait Complete<'d>: Sized {
fn dispatch<'app>(
call: executor::raw::Call<'app, Self, (), io::Event<'d>>,
) -> ops::ControlFlow<io::Event<'d>>;
}
pub trait Drive<'d>: Sized {
type Access;
fn dispatch<'app, 'driver, 'root>(
call: executor::raw::Call<
'app,
Self,
(),
(
io::Event<'d>,
dispatch::raw::Context<'driver, 'root, 'd, Self::Access>,
),
>,
) -> ops::ControlFlow<io::Event<'d>>
where
'd: 'root,
Self: 'root;
}
pub struct Observe;
pub trait Turn<'d>: Sized {
type Access;
fn dispatch<'app, 'driver, 'turn, 'root>(
call: executor::raw::Call<
'app,
Self,
(),
(
io::Event<'d>,
schedule::Turn<'turn, 'd>,
dispatch::raw::Context<'driver, 'root, 'd, Self::Access>,
),
>,
) -> ops::ControlFlow<io::Event<'d>>
where
'd: 'root;
}