rune/shared/
assert_send.rsuse core::future::Future;
use core::pin::Pin;
use core::task::{Context, Poll};
#[pin_project::pin_project]
pub(crate) struct AssertSend<T>(#[pin] T);
impl<T> AssertSend<T> {
pub(crate) unsafe fn new(inner: T) -> Self {
Self(inner)
}
}
unsafe impl<T> Send for AssertSend<T> {}
impl<T> Future for AssertSend<T>
where
T: Future,
{
type Output = T::Output;
fn poll(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Self::Output> {
let this = self.project();
this.0.poll(cx)
}
}