#[macro_use]
mod modtrace_macro;
mod any_of;
mod channel;
mod channel_rt;
mod event_node;
mod join;
mod join_tasks;
mod oneshot;
mod oneshot_rt;
mod pin_macro;
mod reactor;
mod runtime;
mod task;
mod timer;
mod tracer;
mod with_runtime;
pub mod toy_rt;
pub use any_of::AnyOfN;
pub use any_of::{any_of2, any_of3, any_of4, any_of5, any_of6, any_of7, any_of8};
pub use any_of::{OneOf2, OneOf3, OneOf4, OneOf5, OneOf6, OneOf7, OneOf8};
pub use channel::{channel, Recver, Sender};
pub use event_node::EventNode;
pub use join::{join2, join3, join4, join5, join6, join7, join8};
pub use join_tasks::{
join_tasks2, join_tasks3, join_tasks4, join_tasks5, join_tasks6, join_tasks7, join_tasks8,
};
pub use oneshot::{oneshot, RecverOnce, SenderOnce};
pub use reactor::{EventId, Reactor, TemporalReactor};
pub use runtime::Runtime;
pub use timer::sleep;
pub use toy_rt::ToyReactor;
pub use tracer::Tracer;
pub use with_runtime::{with_runtime_base, LifetimeLinkerFn};
#[macro_export]
macro_rules! export_runtime {
($reactor:ident) => {
pub type Runtime = $crate::Runtime<$reactor>;
pub type EventId = $crate::EventId;
pub use $crate::sleep;
pub use $crate::EventNode;
pub use $crate::join;
pub use $crate::join_tasks;
pub use $crate::{join2, join3, join4, join5, join6, join7, join8};
pub use $crate::{
join_tasks2, join_tasks3, join_tasks4, join_tasks5, join_tasks6, join_tasks7,
join_tasks8,
};
pub use $crate::make_any_of;
pub use $crate::pinned_any_of;
pub use $crate::AnyOfN;
pub use $crate::{any_of2, any_of3, any_of4, any_of5, any_of6, any_of7, any_of8};
pub use $crate::{OneOf2, OneOf3, OneOf4, OneOf5, OneOf6, OneOf7, OneOf8};
pub use $crate::pin_local;
pub type RecverOnce<'runtime, T> = $crate::RecverOnce<'runtime, T, $reactor>;
pub type SenderOnce<'runtime, T> = $crate::SenderOnce<'runtime, T, $reactor>;
pub type Recver<'runtime, T> = $crate::Recver<'runtime, T, $reactor>;
pub type Sender<'runtime, T> = $crate::Sender<'runtime, T, $reactor>;
pub fn oneshot<'runtime, T>(
rt: &'runtime Runtime,
) -> (
$crate::SenderOnce<'runtime, T, $reactor>,
$crate::RecverOnce<'runtime, T, $reactor>,
) {
$crate::oneshot::<T, $reactor>(rt)
}
pub fn channel<'runtime, T>(
rt: &'runtime Runtime,
) -> (
$crate::Sender<'runtime, T, $reactor>,
$crate::Recver<'runtime, T, $reactor>,
) {
$crate::channel::<T, $reactor>(rt)
}
pub fn with_runtime<ReactorFn, FuncT, InitT, ResT>(
reactor_constructor: ReactorFn,
tracer: $crate::Tracer,
async_function: FuncT,
init: InitT,
) -> ResT
where
FuncT: for<'runtime> $crate::LifetimeLinkerFn<'runtime, $reactor, InitT, ResT>,
ReactorFn: FnOnce() -> $reactor,
{
$crate::with_runtime_base(reactor_constructor(), tracer, async_function, init)
}
};
}