Enum futures_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, E, F> FromResidual<Result<Infallible, E>> for Poll<Option<Result<T, F>>> where
F: From<E>,
[src]
impl<T, E, F> FromResidual<Result<Infallible, E>> for Poll<Option<Result<T, F>>> where
F: From<E>,
[src]pub fn from_residual(x: Result<Infallible, E>) -> Poll<Option<Result<T, F>>>
[src]
impl<T, E, F> FromResidual<Result<Infallible, E>> for Poll<Result<T, F>> where
F: From<E>,
[src]
impl<T, E, F> FromResidual<Result<Infallible, E>> for Poll<Result<T, F>> where
F: From<E>,
[src]pub fn from_residual(x: Result<Infallible, E>) -> Poll<Result<T, F>>
[src]
impl<T> PartialOrd<Poll<T>> for Poll<T> where
T: PartialOrd<T>,
[src]
impl<T> PartialOrd<Poll<T>> for Poll<T> where
T: PartialOrd<T>,
[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>
try_trait_v2
)The type of the value produced by ?
when not short-circuiting.
type Residual = Result<Infallible, E>
try_trait_v2
)The type of the value passed to FromResidual::from_residual
as part of ?
when short-circuiting. Read more
pub fn from_output(c: <Poll<Result<T, E>> as Try>::Output) -> Poll<Result<T, E>>
[src]
pub fn branch(
self
) -> ControlFlow<<Poll<Result<T, E>> as Try>::Residual, <Poll<Result<T, E>> as Try>::Output>
[src]
self
) -> ControlFlow<<Poll<Result<T, E>> as Try>::Residual, <Poll<Result<T, E>> as Try>::Output>
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>>
try_trait_v2
)The type of the value produced by ?
when not short-circuiting.
type Residual = Result<Infallible, E>
try_trait_v2
)The type of the value passed to FromResidual::from_residual
as part of ?
when short-circuiting. Read more
pub fn from_output(
c: <Poll<Option<Result<T, E>>> as Try>::Output
) -> Poll<Option<Result<T, E>>>
[src]
c: <Poll<Option<Result<T, E>>> as Try>::Output
) -> Poll<Option<Result<T, E>>>
pub fn branch(
self
) -> ControlFlow<<Poll<Option<Result<T, E>>> as Try>::Residual, <Poll<Option<Result<T, E>>> as Try>::Output>
[src]
self
) -> ControlFlow<<Poll<Option<Result<T, E>>> as Try>::Residual, <Poll<Option<Result<T, E>>> as Try>::Output>
impl<T, E> Try for Poll<Result<T, E>>
[src]
impl<T, E> Try for Poll<Result<T, E>>
[src]type Ok = Poll<T>
try_trait
)The type of this value when viewed as successful.
type Error = E
try_trait
)The type of this value when viewed as failed.
pub fn into_result(
self
) -> Result<<Poll<Result<T, E>> as Try>::Ok, <Poll<Result<T, E>> as Try>::Error>
[src]
self
) -> Result<<Poll<Result<T, E>> as Try>::Ok, <Poll<Result<T, E>> as Try>::Error>
pub fn from_error(e: <Poll<Result<T, E>> as Try>::Error) -> Poll<Result<T, E>>
[src]
pub 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]
impl<T, E> Try for Poll<Option<Result<T, E>>>
[src]type Ok = Poll<Option<T>>
try_trait
)The type of this value when viewed as successful.
type Error = E
try_trait
)The type of this value when viewed as failed.
pub fn into_result(
self
) -> Result<<Poll<Option<Result<T, E>>> as Try>::Ok, <Poll<Option<Result<T, E>>> as Try>::Error>
[src]
self
) -> Result<<Poll<Option<Result<T, E>>> as Try>::Ok, <Poll<Option<Result<T, E>>> as Try>::Error>
pub fn from_error(
e: <Poll<Option<Result<T, E>>> as Try>::Error
) -> Poll<Option<Result<T, E>>>
[src]
e: <Poll<Option<Result<T, E>>> as Try>::Error
) -> Poll<Option<Result<T, E>>>
pub fn from_ok(
x: <Poll<Option<Result<T, E>>> as Try>::Ok
) -> Poll<Option<Result<T, E>>>
[src]
x: <Poll<Option<Result<T, E>>> as Try>::Ok
) -> Poll<Option<Result<T, E>>>
impl<T> Copy for Poll<T> where
T: Copy,
[src]
T: Copy,
impl<T> Eq for Poll<T> where
T: Eq,
[src]
T: Eq,
impl<T> StructuralEq for Poll<T>
[src]
impl<T> StructuralPartialEq for Poll<T>
[src]
Auto Trait Implementations
impl<T> RefUnwindSafe for Poll<T> where
T: RefUnwindSafe,
T: RefUnwindSafe,
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,
impl<T> UnwindSafe for Poll<T> where
T: UnwindSafe,
T: UnwindSafe,