Struct futures_task::LocalFutureObj
source · [−]pub struct LocalFutureObj<'a, T> { /* private fields */ }
Expand description
A custom trait object for polling futures, roughly akin to
Box<dyn Future<Output = T> + 'a>
.
This custom trait object was introduced as currently it is not possible to
take dyn Trait
by value and Box<dyn Trait>
is not available in no_std
contexts.
Implementations
sourceimpl<'a, T> LocalFutureObj<'a, T>
impl<'a, T> LocalFutureObj<'a, T>
sourcepub fn new<F: UnsafeFutureObj<'a, T> + 'a>(f: F) -> Self
pub fn new<F: UnsafeFutureObj<'a, T> + 'a>(f: F) -> Self
Create a LocalFutureObj
from a custom trait object representation.
sourcepub unsafe fn into_future_obj(self) -> FutureObj<'a, T>ⓘNotable traits for FutureObj<'_, T>impl<T> Future for FutureObj<'_, T> type Output = T;
pub unsafe fn into_future_obj(self) -> FutureObj<'a, T>ⓘNotable traits for FutureObj<'_, T>impl<T> Future for FutureObj<'_, T> type Output = T;
Converts the LocalFutureObj
into a FutureObj
.
Safety
To make this operation safe one has to ensure that the UnsafeFutureObj
instance from which this LocalFutureObj
was created actually
implements Send
.
Trait Implementations
sourceimpl<T> Debug for LocalFutureObj<'_, T>
impl<T> Debug for LocalFutureObj<'_, T>
sourceimpl<T> Drop for LocalFutureObj<'_, T>
impl<T> Drop for LocalFutureObj<'_, T>
sourceimpl<'a, T> From<FutureObj<'a, T>> for LocalFutureObj<'a, T>
impl<'a, T> From<FutureObj<'a, T>> for LocalFutureObj<'a, T>
sourceimpl<T> Future for LocalFutureObj<'_, T>
impl<T> Future for LocalFutureObj<'_, T>
impl<T> Unpin for LocalFutureObj<'_, T>
Auto Trait Implementations
impl<'a, T> !RefUnwindSafe for LocalFutureObj<'a, T>
impl<'a, T> !Send for LocalFutureObj<'a, T>
impl<'a, T> !Sync for LocalFutureObj<'a, T>
impl<'a, T> !UnwindSafe for LocalFutureObj<'a, T>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<F> IntoFuture for F where
F: Future,
impl<F> IntoFuture for F where
F: Future,
type IntoFuture = F
type IntoFuture = F
Which kind of future are we turning this into?
sourcefn into_future(self) -> <F as IntoFuture>::IntoFuture
fn into_future(self) -> <F as IntoFuture>::IntoFuture
Creates a future from a value. Read more