Crate maybe_async_channel
source ·Expand description
A channel which may or may not be async.
This crate is an experimental desugaring of what actual “maybe-async” syntax might look like.
Syntactic Sugar
We can imagine this crate would act as a desugaring for the following:
pub ?async fn bounded(cap: usize) -> (?async Sender<T>, ?async Receiver<T>);
pub ?async fn unbounded() -> (?async Sender<T>, ?async Receiver<T>);
pub ?async struct Sender<T>;
impl<T> ?async Sender<T> {
?async fn send(&self, msg: T) -> Result<(), SendError>;
}
pub ?async struct Receiver<T>;
impl<T> ?async Receiver<T> {
?async fn recv(&self) -> Result<T, RecvError>;
}
Modules
A crate of helpers to create “maybe-async” types and traits.