1.36.0[][src]Enum std::task::Poll

#[must_use = "this `Poll` may be a `Pending` variant, which should be handled"]
pub enum Poll<T> {
    Ready(T),
    Pending,
}

Indicates whether a value is available or if the current task has been scheduled to receive a wakeup instead.

Variants

Ready(T)

Represents that a value is immediately ready.

Pending

Represents that a value is not ready yet.

When a function returns Pending, the function must also ensure that the current task is scheduled to be awoken when progress can be made.

Methods

impl<T> Poll<T>[src]

pub fn map<U, F>(self, f: F) -> Poll<U> where
    F: FnOnce(T) -> U, 
[src]

Changes the ready value of this Poll with the closure provided.

pub fn is_ready(&self) -> bool[src]

Returns true if this is Poll::Ready

pub fn is_pending(&self) -> bool[src]

Returns true if this is Poll::Pending

impl<T, E> Poll<Result<T, E>>[src]

pub fn map_ok<U, F>(self, f: F) -> Poll<Result<U, E>> where
    F: FnOnce(T) -> U, 
[src]

Changes the success value of this Poll with the closure provided.

pub fn map_err<U, F>(self, f: F) -> Poll<Result<T, U>> where
    F: FnOnce(E) -> U, 
[src]

Changes the error value of this Poll with the closure provided.

Trait Implementations

impl<T> PartialOrd<Poll<T>> for Poll<T> where
    T: PartialOrd<T>, 
[src]

impl<T> Clone for Poll<T> where
    T: Clone
[src]

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl<T> Eq for Poll<T> where
    T: Eq
[src]

impl<T, E> Try for Poll<Result<T, E>>[src]

type Ok = Poll<T>

🔬 This is a nightly-only experimental API. (try_trait #42327)

The type of this value when viewed as successful.

type Error = E

🔬 This is a nightly-only experimental API. (try_trait #42327)

The type of this value when viewed as failed.

impl<T, E> Try for Poll<Option<Result<T, E>>>[src]

type Ok = Poll<Option<T>>

🔬 This is a nightly-only experimental API. (try_trait #42327)

The type of this value when viewed as successful.

type Error = E

🔬 This is a nightly-only experimental API. (try_trait #42327)

The type of this value when viewed as failed.

impl<T> Ord for Poll<T> where
    T: Ord
[src]

fn max(self, other: Self) -> Self1.21.0[src]

Compares and returns the maximum of two values. Read more

fn min(self, other: Self) -> Self1.21.0[src]

Compares and returns the minimum of two values. Read more

fn clamp(self, min: Self, max: Self) -> Self[src]

🔬 This is a nightly-only experimental API. (clamp #44095)

Restrict a value to a certain interval. Read more

impl<T> PartialEq<Poll<T>> for Poll<T> where
    T: PartialEq<T>, 
[src]

impl<T> Hash for Poll<T> where
    T: Hash
[src]

fn hash_slice<H>(data: &[Self], state: &mut H) where
    H: Hasher
1.3.0[src]

Feeds a slice of this type into the given [Hasher]. Read more

impl<T> From<T> for Poll<T>[src]

impl<T> Copy for Poll<T> where
    T: Copy
[src]

impl<T> Debug for Poll<T> where
    T: Debug
[src]

Auto Trait Implementations

impl<T> Send for Poll<T> where
    T: Send

impl<T> Sync for Poll<T> where
    T: Sync

Blanket Implementations

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.