1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
use crate::*;
pub type GhostChanRespond<T> = Box<dyn FnOnce(T) -> GhostResult<()> + 'static + Send>;
pub trait GhostChanSend<T: 'static + Send> {
fn ghost_chan_send(&mut self, item: T) -> ::must_future::MustBoxFuture<'_, GhostResult<()>>;
}
impl<T: 'static + Send> GhostChanSend<T> for ::futures::channel::mpsc::Sender<T> {
fn ghost_chan_send(&mut self, item: T) -> ::must_future::MustBoxFuture<'_, GhostResult<()>> {
use ::futures::{future::FutureExt, sink::SinkExt};
let send_fut = self.send(item);
async move {
send_fut.await?;
Ok(())
}
.boxed()
.into()
}
}
#[macro_use]
mod r#macro;
pub use r#macro::*;