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§
Source§impl<'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> ⓘ
pub unsafe fn into_future_obj(self) -> FutureObj<'a, 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§
Source§impl<T> Debug for LocalFutureObj<'_, T>
impl<T> Debug for LocalFutureObj<'_, T>
Source§impl<T> Drop for LocalFutureObj<'_, T>
impl<T> Drop for LocalFutureObj<'_, T>
Source§impl<'a, F: Future<Output = ()> + 'a> From<Box<F>> for LocalFutureObj<'a, ()>
impl<'a, F: Future<Output = ()> + 'a> From<Box<F>> for LocalFutureObj<'a, ()>
Source§impl<'a> From<Box<dyn Future<Output = ()> + 'a>> for LocalFutureObj<'a, ()>
impl<'a> From<Box<dyn Future<Output = ()> + 'a>> for LocalFutureObj<'a, ()>
Source§impl<'a, T> From<FutureObj<'a, T>> for LocalFutureObj<'a, T>
impl<'a, T> From<FutureObj<'a, T>> for LocalFutureObj<'a, T>
Source§impl<'a, F: Future<Output = ()> + 'a> From<Pin<Box<F>>> for LocalFutureObj<'a, ()>
impl<'a, F: Future<Output = ()> + 'a> From<Pin<Box<F>>> for LocalFutureObj<'a, ()>
Source§impl<'a> From<Pin<Box<dyn Future<Output = ()> + 'a>>> for LocalFutureObj<'a, ()>
impl<'a> From<Pin<Box<dyn Future<Output = ()> + 'a>>> for LocalFutureObj<'a, ()>
Source§impl<T> Future for LocalFutureObj<'_, T>
impl<T> Future for LocalFutureObj<'_, T>
impl<T> Unpin for LocalFutureObj<'_, T>
Auto Trait Implementations§
impl<'a, T> Freeze for LocalFutureObj<'a, T>
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§
§impl<T> Any for Twhere
T: 'static + ?Sized,
impl<T> Any for Twhere
T: 'static + ?Sized,
§impl<T> Borrow<T> for Twhere
T: ?Sized,
impl<T> Borrow<T> for Twhere
T: ?Sized,
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T, U> Into<U> for Twhere
U: From<T>,
impl<T, U> Into<U> for Twhere
U: From<T>,
§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?
§fn into_future(self) -> <F as IntoFuture>::IntoFuture
fn into_future(self) -> <F as IntoFuture>::IntoFuture
Creates a future from a value. Read more