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, T> From<FutureObj<'a, T>> for LocalFutureObj<'a, T>
impl<'a, T> From<FutureObj<'a, T>> for LocalFutureObj<'a, T>
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§
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
Source§impl<F> IntoFuture for Fwhere
F: Future,
impl<F> IntoFuture for Fwhere
F: Future,
Source§type IntoFuture = F
type IntoFuture = F
Source§fn into_future(self) -> <F as IntoFuture>::IntoFuture
fn into_future(self) -> <F as IntoFuture>::IntoFuture
Layout§
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...)
attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.
Size: 24 bytes