Enum core::task::Poll [−][src]
pub enum Poll<T> { Ready(T), Pending, }
🔬 This is a nightly-only experimental API. (futures_api
#50547)
futures in libcore are unstable
Indicates whether a value is available or if the current task has been scheduled to receive a wakeup instead.
Variants
Ready(T)
🔬 This is a nightly-only experimental API. (futures_api
#50547)
futures in libcore are unstable
Represents that a value is immediately ready.
Pending
🔬 This is a nightly-only experimental API. (futures_api
#50547)
futures in libcore are unstable
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]
impl<T> Poll<T>
pub fn map<U, F>(self, f: F) -> Poll<U> where
F: FnOnce(T) -> U,
[src]
pub fn map<U, F>(self, f: F) -> Poll<U> where
F: FnOnce(T) -> U,
🔬 This is a nightly-only experimental API. (futures_api
#50547)
futures in libcore are unstable
Change the ready value of this Poll
with the closure provided
pub fn is_ready(&self) -> bool
[src]
pub fn is_ready(&self) -> bool
🔬 This is a nightly-only experimental API. (futures_api
#50547)
futures in libcore are unstable
Returns whether this is Poll::Ready
pub fn is_pending(&self) -> bool
[src]
pub fn is_pending(&self) -> bool
🔬 This is a nightly-only experimental API. (futures_api
#50547)
futures in libcore are unstable
Returns whether this is Poll::Pending
impl<T, E> Poll<Result<T, E>>
[src]
impl<T, E> Poll<Result<T, E>>
pub fn map_ok<U, F>(self, f: F) -> Poll<Result<U, E>> where
F: FnOnce(T) -> U,
[src]
pub fn map_ok<U, F>(self, f: F) -> Poll<Result<U, E>> where
F: FnOnce(T) -> U,
🔬 This is a nightly-only experimental API. (futures_api
#50547)
futures in libcore are unstable
Change 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]
pub fn map_err<U, F>(self, f: F) -> Poll<Result<T, U>> where
F: FnOnce(E) -> U,
🔬 This is a nightly-only experimental API. (futures_api
#50547)
futures in libcore are unstable
Change the error value of this Poll
with the closure provided
Trait Implementations
impl<T: Copy> Copy for Poll<T>
[src]
impl<T: Copy> Copy for Poll<T>
impl<T: Clone> Clone for Poll<T>
[src]
impl<T: Clone> Clone for Poll<T>
fn clone(&self) -> Poll<T>
[src]
fn clone(&self) -> Poll<T>
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
impl<T: Debug> Debug for Poll<T>
[src]
impl<T: Debug> Debug for Poll<T>
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl<T: Eq> Eq for Poll<T>
[src]
impl<T: Eq> Eq for Poll<T>
impl<T: PartialEq> PartialEq for Poll<T>
[src]
impl<T: PartialEq> PartialEq for Poll<T>
fn eq(&self, other: &Poll<T>) -> bool
[src]
fn eq(&self, other: &Poll<T>) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &Poll<T>) -> bool
[src]
fn ne(&self, other: &Poll<T>) -> bool
This method tests for !=
.
impl<T: Ord> Ord for Poll<T>
[src]
impl<T: Ord> Ord for Poll<T>
fn cmp(&self, other: &Poll<T>) -> Ordering
[src]
fn cmp(&self, other: &Poll<T>) -> Ordering
This method returns an Ordering
between self
and other
. Read more
fn max(self, other: Self) -> Self where
Self: Sized,
1.21.0[src]
fn max(self, other: Self) -> Self where
Self: Sized,
Compares and returns the maximum of two values. Read more
fn min(self, other: Self) -> Self where
Self: Sized,
1.21.0[src]
fn min(self, other: Self) -> Self where
Self: Sized,
Compares and returns the minimum of two values. Read more
impl<T: PartialOrd> PartialOrd for Poll<T>
[src]
impl<T: PartialOrd> PartialOrd for Poll<T>
fn partial_cmp(&self, other: &Poll<T>) -> Option<Ordering>
[src]
fn partial_cmp(&self, other: &Poll<T>) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
fn lt(&self, other: &Poll<T>) -> bool
[src]
fn lt(&self, other: &Poll<T>) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
fn le(&self, other: &Poll<T>) -> bool
[src]
fn le(&self, other: &Poll<T>) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
fn gt(&self, other: &Poll<T>) -> bool
[src]
fn gt(&self, other: &Poll<T>) -> bool
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
fn ge(&self, other: &Poll<T>) -> bool
[src]
fn ge(&self, other: &Poll<T>) -> bool
This method tests greater than or equal to (for self
and other
) and is used by the >=
operator. Read more
impl<T: Hash> Hash for Poll<T>
[src]
impl<T: Hash> Hash for Poll<T>
fn hash<__HT: Hasher>(&self, state: &mut __HT)
[src]
fn hash<__HT: Hasher>(&self, state: &mut __HT)
Feeds this value into the given [Hasher
]. Read more
fn hash_slice<H: Hasher>(data: &[Self], state: &mut H) where
Self: Sized,
1.3.0[src]
fn hash_slice<H: Hasher>(data: &[Self], state: &mut H) where
Self: Sized,
Feeds a slice of this type into the given [Hasher
]. Read more
impl<T> From<T> for Poll<T>
[src]
impl<T> From<T> for Poll<T>