rune/shared/
assert_send.rs1use core::future::Future;
2use core::pin::Pin;
3use core::task::{Context, Poll};
4
5#[pin_project::pin_project]
7pub(crate) struct AssertSend<T>(#[pin] T);
8
9impl<T> AssertSend<T> {
10 pub(crate) unsafe fn new(inner: T) -> Self {
17 Self(inner)
18 }
19}
20
21unsafe impl<T> Send for AssertSend<T> {}
24
25impl<T> Future for AssertSend<T>
26where
27 T: Future,
28{
29 type Output = T::Output;
30
31 fn poll(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Self::Output> {
32 let this = self.project();
33 this.0.poll(cx)
34 }
35}