#![doc = include_str!("../examples/counter.rs")]
#![cfg_attr(not(feature = "std"), no_std)]
#![doc(
html_logo_url = "https://ardaku.github.io/mm/logo.svg",
html_favicon_url = "https://ardaku.github.io/mm/icon.svg",
html_root_url = "https://docs.rs/pasts"
)]
#![forbid(unsafe_code)]
#![warn(
anonymous_parameters,
missing_copy_implementations,
missing_debug_implementations,
missing_docs,
nonstandard_style,
rust_2018_idioms,
single_use_lifetimes,
trivial_casts,
trivial_numeric_casts,
unreachable_pub,
unused_extern_crates,
unused_qualifications,
variant_size_differences
)]
extern crate alloc;
mod join;
mod noti;
mod spawn;
use self::prelude::*;
pub use self::{
join::Join,
noti::{Fuse, Loop, Notifier, Poller},
spawn::{Executor, Park, Pool, Spawn},
};
pub type BoxNotifier<'a, T = ()> =
Pin<Box<dyn Notifier<Event = T> + Send + 'a>>;
pub type LocalBoxNotifier<'a, T = ()> = Pin<Box<dyn Notifier<Event = T> + 'a>>;
impl<T> core::fmt::Debug for LocalBoxNotifier<'_, T> {
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
f.write_str("LocalBoxNotifier")
}
}
pub mod prelude {
#[doc(no_inline)]
pub use alloc::boxed::Box;
#[doc(no_inline)]
pub use core::{
future::Future,
pin::Pin,
task::{
Context as Task,
Poll::{Pending, Ready},
},
};
#[doc(no_inline)]
pub use crate::{BoxNotifier, Fuse, LocalBoxNotifier, Notifier, Spawn};
pub type Poll<T = ()> = core::task::Poll<T>;
}