Enum core::task::Poll 1.36.0[−][src]
#[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
Represents that a value is immediately ready.
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.
Implementations
impl<T> Poll<T>
[src]
impl<T> Poll<T>
[src]pub fn map<U, F>(self, f: F) -> Poll<U> where
F: FnOnce(T) -> U,
[src]
F: FnOnce(T) -> U,
Changes the ready value of this Poll
with the closure provided.
pub const fn is_ready(&self) -> bool
1.36.0 (const: 1.49.0)[src]
Returns true
if this is Poll::Ready
pub const fn is_pending(&self) -> bool
1.36.0 (const: 1.49.0)[src]
Returns true
if this is Poll::Pending
impl<T, E> Poll<Result<T, E>>
[src]
impl<T, E> Poll<Result<T, E>>
[src]impl<T, E> Poll<Option<Result<T, E>>>
[src]
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,
1.51.0[src]
F: FnOnce(T) -> U,
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,
1.51.0[src]
F: FnOnce(E) -> U,
Changes the error value of this Poll
with the closure provided.
Trait Implementations
impl<T: Clone> Clone for Poll<T>
[src]
impl<T: Clone> Clone for Poll<T>
[src]fn clone(&self) -> Poll<T>
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl<T, E, F: From<E>> FromResidual<Result<Infallible, E>> for Poll<Result<T, F>>
[src]
impl<T, E, F: From<E>> FromResidual<Result<Infallible, E>> for Poll<Result<T, F>>
[src]fn from_residual(x: Result<Infallible, E>) -> Self
[src]
impl<T, E, F: From<E>> FromResidual<Result<Infallible, E>> for Poll<Option<Result<T, F>>>
[src]
impl<T, E, F: From<E>> FromResidual<Result<Infallible, E>> for Poll<Option<Result<T, F>>>
[src]fn from_residual(x: Result<Infallible, E>) -> Self
[src]
impl<T: PartialOrd> PartialOrd<Poll<T>> for Poll<T>
[src]
impl<T: PartialOrd> PartialOrd<Poll<T>> for Poll<T>
[src]impl<T, E> Try for Poll<Result<T, E>>
[src]
impl<T, E> Try for Poll<Result<T, E>>
[src]impl<T, E> Try for Poll<Option<Result<T, E>>>
[src]
impl<T, E> Try for Poll<Option<Result<T, E>>>
[src]impl<T, E> Try for Poll<Result<T, E>>
[src]
impl<T, E> Try for Poll<Result<T, E>>
[src]type Output = Poll<T>
The type of the value produced by ?
when not short-circuiting.
type Residual = Result<Infallible, E>
The type of the value passed to FromResidual::from_residual
as part of ?
when short-circuiting. Read more
fn from_output(c: Self::Output) -> Self
[src]
fn branch(self) -> ControlFlow<Self::Residual, Self::Output>
[src]
impl<T, E> Try for Poll<Option<Result<T, E>>>
[src]
impl<T, E> Try for Poll<Option<Result<T, E>>>
[src]type Output = Poll<Option<T>>
The type of the value produced by ?
when not short-circuiting.
type Residual = Result<Infallible, E>
The type of the value passed to FromResidual::from_residual
as part of ?
when short-circuiting. Read more
fn from_output(c: Self::Output) -> Self
[src]
fn branch(self) -> ControlFlow<Self::Residual, Self::Output>
[src]
impl<T: Copy> Copy for Poll<T>
[src]
impl<T: Eq> Eq for Poll<T>
[src]
impl<T> StructuralEq for Poll<T>
[src]
impl<T> StructuralPartialEq for Poll<T>
[src]
Auto Trait Implementations
impl<T> Send for Poll<T> where
T: Send,
T: Send,
impl<T> Sync for Poll<T> where
T: Sync,
T: Sync,
impl<T> Unpin for Poll<T> where
T: Unpin,
T: Unpin,