pub enum TaskFuture<F>where
F: Future,{
Future {
future: F,
},
Result {
result: Option<Result<F::Output, Box<dyn Any + Send + 'static>>>,
},
}Expand description
TaskFuture is either a future that is being polled, or a result
returned by that future, or a panic result from polling the future.
Variants§
Trait Implementations§
Source§impl<F: Future> FutureOrResult for TaskFuture<F>
impl<F: Future> FutureOrResult for TaskFuture<F>
Source§fn poll(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<()>
fn poll(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<()>
Poll the future. When the future is ready, this will return
Poll::Ready(()),
and the result call can be used to discover the result.Source§unsafe fn result(
self: Pin<&mut Self>,
out_value: *mut (),
) -> Option<Result<(), Box<dyn Any + Send + 'static>>>
unsafe fn result( self: Pin<&mut Self>, out_value: *mut (), ) -> Option<Result<(), Box<dyn Any + Send + 'static>>>
Retrieve the result of the future. None is returned if the future has
not been polled to completion, or if the result has already been retrieved.
Some(()) indicates that the value has been written to the
value pointer.
Some(Err(e)) indicates the future panicked, and e is the panic value. Read moreimpl<'__pin, F> Unpin for TaskFuture<F>
Auto Trait Implementations§
impl<F> !RefUnwindSafe for TaskFuture<F>
impl<F> !Sync for TaskFuture<F>
impl<F> !UnwindSafe for TaskFuture<F>
impl<F> Freeze for TaskFuture<F>
impl<F> Send for TaskFuture<F>
impl<F> UnsafeUnpin for TaskFuture<F>
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