#[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.
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.
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.
impl<T, E> Poll<Option<Result<T, E>>>
[src]
pub fn map_ok<U, F>(self, f: F) -> Poll<Option<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<Option<Result<T, U>>> where
F: FnOnce(E) -> U,
[src]
Changes the error value of this Poll
with the closure provided.
impl<T> Clone for Poll<T> where
T: Clone,
[src]
impl<T> Copy for Poll<T> where
T: Copy,
[src]
impl<T> Debug for Poll<T> where
T: Debug,
[src]
impl<T> Eq for Poll<T> where
T: Eq,
[src]
impl<T> From<T> for Poll<T>
[src]
impl<T> Hash for Poll<T> where
T: Hash,
[src]
fn hash<__H>(&self, state: &mut __H) where
__H: Hasher,
[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
[src]1.3.0
impl<T> Ord for Poll<T> where
T: Ord,
[src]
fn cmp(&self, other: &Poll<T>) -> Ordering
[src]
fn max(self, other: Self) -> Self
[src]1.21.0
fn min(self, other: Self) -> Self
[src]1.21.0
fn clamp(self, min: Self, max: Self) -> Self
[src]
impl<T> PartialEq<Poll<T>> for Poll<T> where
T: PartialEq<T>,
[src]
impl<T> PartialOrd<Poll<T>> for Poll<T> where
T: PartialOrd<T>,
[src]
fn partial_cmp(&self, other: &Poll<T>) -> Option<Ordering>
[src]
fn lt(&self, other: &Poll<T>) -> bool
[src]
fn le(&self, other: &Poll<T>) -> bool
[src]
fn gt(&self, other: &Poll<T>) -> bool
[src]
fn ge(&self, other: &Poll<T>) -> bool
[src]
impl<T> StructuralEq for Poll<T>
[src]
impl<T> StructuralPartialEq for Poll<T>
[src]
impl<T, E> Try for Poll<Result<T, E>>
[src]
type Ok = Poll<T>
The type of this value when viewed as successful.
type Error = E
The type of this value when viewed as failed.
fn into_result(
self
) -> Result<<Poll<Result<T, E>> as Try>::Ok, <Poll<Result<T, E>> as Try>::Error>
[src]
fn from_error(e: <Poll<Result<T, E>> as Try>::Error) -> Poll<Result<T, E>>
[src]
fn from_ok(x: <Poll<Result<T, E>> as Try>::Ok) -> Poll<Result<T, E>>
[src]
impl<T, E> Try for Poll<Option<Result<T, E>>>
[src]
type Ok = Poll<Option<T>>
The type of this value when viewed as successful.
type Error = E
The type of this value when viewed as failed.
fn into_result(
self
) -> Result<<Poll<Option<Result<T, E>>> as Try>::Ok, <Poll<Option<Result<T, E>>> as Try>::Error>
[src]
fn from_error(
e: <Poll<Option<Result<T, E>>> as Try>::Error
) -> Poll<Option<Result<T, E>>>
[src]
fn from_ok(
x: <Poll<Option<Result<T, E>>> as Try>::Ok
) -> Poll<Option<Result<T, E>>>
[src]
impl<T> RefUnwindSafe for Poll<T> where
T: RefUnwindSafe,
impl<T> Send for Poll<T> where
T: Send,
impl<T> Sync for Poll<T> where
T: Sync,
impl<T> Unpin for Poll<T> where
T: Unpin,
impl<T> UnwindSafe for Poll<T> where
T: UnwindSafe,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
fn borrow(&self) -> &TⓘNotable traits for &'_ mut F
impl<'_, F> Future for &'_ mut F where
F: Unpin + Future + ?Sized,
type Output = <F as Future>::Output;
impl<'_, I> Iterator for &'_ mut I where
I: Iterator + ?Sized,
type Item = <I as Iterator>::Item;
impl<R: Read + ?Sized, '_> Read for &'_ mut R
impl<W: Write + ?Sized, '_> Write for &'_ mut W
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
fn borrow_mut(&mut self) -> &mut TⓘNotable traits for &'_ mut F
impl<'_, F> Future for &'_ mut F where
F: Unpin + Future + ?Sized,
type Output = <F as Future>::Output;
impl<'_, I> Iterator for &'_ mut I where
I: Iterator + ?Sized,
type Item = <I as Iterator>::Item;
impl<R: Read + ?Sized, '_> Read for &'_ mut R
impl<W: Write + ?Sized, '_> Write for &'_ mut W
[src]
impl<T> From<!> for T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
impl<T> ToOwned for T where
T: Clone,
[src]
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
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.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
© 2010 The Rust Project Developers
Licensed under the Apache License, Version 2.0 or the MIT license, at your option.
https://doc.rust-lang.org/std/task/enum.Poll.html