[−][src]Trait futures::future::UnsafeFutureObj
A custom implementation of a future trait object for FutureObj
, providing
a hand-rolled vtable.
This custom representation is typically used only in no_std
contexts,
where the default Box
-based implementation is not available.
The implementor must guarantee that it is safe to call poll
repeatedly (in
a non-concurrent fashion) with the result of into_raw
until drop
is
called.
Required methods
fn into_raw(self) -> *mut ()
Convert an owned instance into a (conceptually owned) void pointer.
unsafe fn poll(ptr: *mut (), cx: &mut Context) -> Poll<T>
Poll the future represented by the given void pointer.
Safety
The trait implementor must guarantee that it is safe to repeatedly call
poll
with the result of into_raw
until drop
is called; such calls
are not, however, allowed to race with each other or with calls to
drop
.
unsafe fn drop(ptr: *mut ())
Drops the future represented by the given void pointer.
Safety
The trait implementor must guarantee that it is safe to call this
function once per into_raw
invocation; that call cannot race with
other calls to drop
or poll
.
Implementations on Foreign Types
impl<'a, T, F> UnsafeFutureObj<'a, T> for Box<F> where
F: Future<Output = T> + 'a,
[src]
F: Future<Output = T> + 'a,
fn into_raw(self) -> *mut ()
[src]
unsafe fn poll(ptr: *mut (), cx: &mut Context) -> Poll<T>
[src]
unsafe fn drop(ptr: *mut ())
[src]
impl<'a, T, F> UnsafeFutureObj<'a, T> for Pin<Box<F>> where
F: Future<Output = T> + 'a,
[src]
F: Future<Output = T> + 'a,
fn into_raw(self) -> *mut ()
[src]
unsafe fn poll(ptr: *mut (), cx: &mut Context) -> Poll<T>
[src]
unsafe fn drop(ptr: *mut ())
[src]
impl<'a, T, F> UnsafeFutureObj<'a, T> for &'a mut F where
F: Future<Output = T> + Unpin + 'a,
[src]
F: Future<Output = T> + Unpin + 'a,
fn into_raw(self) -> *mut ()
[src]
unsafe fn poll(ptr: *mut (), cx: &mut Context) -> Poll<T>
[src]
unsafe fn drop(_ptr: *mut ())
[src]
impl<'a, T, F> UnsafeFutureObj<'a, T> for Pin<&'a mut F> where
F: Future<Output = T> + 'a,
[src]
F: Future<Output = T> + 'a,