Skip to main content

TaskFuture

Enum TaskFuture 

Source
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§

§

Future

Fields

§future: F
§

Result

Fields

§result: Option<Result<F::Output, Box<dyn Any + Send + 'static>>>

Trait Implementations§

Source§

impl<F: Future> FutureOrResult for TaskFuture<F>

Source§

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>>>

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 more
Source§

impl<'__pin, F> Unpin for TaskFuture<F>
where PinnedFieldsOf<__Origin<'__pin, F>>: Unpin, F: Future,

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>
where F: Freeze, Option<Result<<F as Future>::Output, Box<dyn Any + Send>>>: Freeze,

§

impl<F> Send for TaskFuture<F>
where F: Send, Option<Result<<F as Future>::Output, Box<dyn Any + Send>>>: Send,

§

impl<F> UnsafeUnpin for TaskFuture<F>
where F: UnsafeUnpin, Option<Result<<F as Future>::Output, Box<dyn Any + Send>>>: UnsafeUnpin,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.