Struct deno_unsync::MaskFutureAsSend
source · #[repr(transparent)]pub struct MaskFutureAsSend<F> { /* private fields */ }
Implementations§
source§impl<F> MaskFutureAsSend<F>
impl<F> MaskFutureAsSend<F>
sourcepub unsafe fn new(future: F) -> Self
pub unsafe fn new(future: F) -> Self
Mark a non-Send
future as Send
. This is a trick to be able to use
tokio::spawn()
(which requires Send
futures) in a current thread
runtime.
Safety
You must ensure that the future is actually used on the same thread, ie. always use current thread runtime flavor from Tokio.
Trait Implementations§
source§impl<F: Future> Future for MaskFutureAsSend<F>
impl<F: Future> Future for MaskFutureAsSend<F>
impl<F> Send for MaskFutureAsSend<F>
Auto Trait Implementations§
impl<F> RefUnwindSafe for MaskFutureAsSend<F>where F: RefUnwindSafe,
impl<F> Sync for MaskFutureAsSend<F>where F: Sync,
impl<F> Unpin for MaskFutureAsSend<F>where F: Unpin,
impl<F> UnwindSafe for MaskFutureAsSend<F>where F: UnwindSafe,
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<F> IntoFuture for Fwhere
F: Future,
impl<F> IntoFuture for Fwhere F: Future,
§type IntoFuture = F
type IntoFuture = F
Which kind of future are we turning this into?
source§fn into_future(self) -> <F as IntoFuture>::IntoFuture
fn into_future(self) -> <F as IntoFuture>::IntoFuture
Creates a future from a value. Read more