roa-core 0.5.0-alpha

core components of roa web framework
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use futures::task::{Context, Poll};
use std::future::Future;
use std::pin::Pin;

pub struct SendFuture<F>(pub F);

impl<F> Future for SendFuture<F>
where
    F: 'static + Future + Unpin,
{
    type Output = F::Output;
    fn poll(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Self::Output> {
        Pin::new(&mut self.0).poll(cx)
    }
}

unsafe impl<F> Send for SendFuture<F> {}