Enum Async

Source
pub enum Async<Item> {
    Ready(Item),
    NotReady,
    DidWork,
    NothingToDo,
}
Expand description

Return type of a component of a future or stream, indicating whether a value is ready, or if not, what actions were taken.

Variants§

§

Ready(Item)

We have a value for the main loop to return immediately.

§

NotReady

One of our inner futures returned futures::Async::NotReady. If all of our other components return either NothingToDo or NotReady, then our overall future should return NotReady and wait to be polled again.

§

DidWork

We did some work (moved our internal state closer to being ready to return a value), but we aren’t ready to return a value yet. We should re-run all of the poll functions to see if the state modification made any of them also able to make progress.

§

NothingToDo

We didn’t poll any inner futures or otherwise change our internal state at all, so rerunning is unlikely to make progress. If all components return either NothingToDo or NotReady (and at least one returns NotReady), then we should just return NotReady and wait to be polled again. It is an error (panic) for all component poll methods to return NothingToDo.

Trait Implementations§

Source§

impl<Item: Clone> Clone for Async<Item>

Source§

fn clone(&self) -> Async<Item>

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<Item: Debug> Debug for Async<Item>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<Item: PartialEq> PartialEq for Async<Item>

Source§

fn eq(&self, other: &Async<Item>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<Item: Copy> Copy for Async<Item>

Source§

impl<Item: Eq> Eq for Async<Item>

Source§

impl<Item> StructuralPartialEq for Async<Item>

Auto Trait Implementations§

§

impl<Item> Freeze for Async<Item>
where Item: Freeze,

§

impl<Item> RefUnwindSafe for Async<Item>
where Item: RefUnwindSafe,

§

impl<Item> Send for Async<Item>
where Item: Send,

§

impl<Item> Sync for Async<Item>
where Item: Sync,

§

impl<Item> Unpin for Async<Item>
where Item: Unpin,

§

impl<Item> UnwindSafe for Async<Item>
where Item: UnwindSafe,

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<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

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

Source§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.