Enum std::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) -> bool1.36.0 (const: 1.49.0)[src]
Returns true if this is Poll::Ready
pub const fn is_pending(&self) -> bool1.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> 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> StructuralEq for Poll<T>[src]
impl<T> StructuralEq for Poll<T>[src]impl<T> StructuralPartialEq for Poll<T>[src]
impl<T> StructuralPartialEq for Poll<T>[src]impl<T, E> Try for Poll<Result<T, E>>[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.
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>>
The type of this value when viewed as successful.
type Error = E
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>>>
Auto Trait Implementations
impl<T> RefUnwindSafe for Poll<T> where
T: RefUnwindSafe,
impl<T> RefUnwindSafe for Poll<T> where
T: RefUnwindSafe, impl<T> UnwindSafe for Poll<T> where
T: UnwindSafe,
impl<T> UnwindSafe for Poll<T> where
T: UnwindSafe, Blanket Implementations
impl<T> Borrow<T> for T where
T: ?Sized, [src]
impl<T> Borrow<T> for T where
T: ?Sized, [src]pub fn borrow(&self) -> &TⓘNotable traits for &'_ mut I
impl<'_, I> Iterator for &'_ mut I where
I: Iterator + ?Sized, type Item = <I as Iterator>::Item;impl<'_, F> Future for &'_ mut F where
F: Future + Unpin + ?Sized, type Output = <F as Future>::Output;impl<R: Read + ?Sized> Read for &mut Rimpl<W: Write + ?Sized> Write for &mut W[src]
Notable traits for &'_ mut I
impl<'_, I> Iterator for &'_ mut I where
I: Iterator + ?Sized, type Item = <I as Iterator>::Item;impl<'_, F> Future for &'_ mut F where
F: Future + Unpin + ?Sized, type Output = <F as Future>::Output;impl<R: Read + ?Sized> Read for &mut Rimpl<W: Write + ?Sized> Write for &mut Wimpl<T> BorrowMut<T> for T where
T: ?Sized, [src]
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]pub fn borrow_mut(&mut self) -> &mut TⓘNotable traits for &'_ mut I
impl<'_, I> Iterator for &'_ mut I where
I: Iterator + ?Sized, type Item = <I as Iterator>::Item;impl<'_, F> Future for &'_ mut F where
F: Future + Unpin + ?Sized, type Output = <F as Future>::Output;impl<R: Read + ?Sized> Read for &mut Rimpl<W: Write + ?Sized> Write for &mut W[src]
Notable traits for &'_ mut I
impl<'_, I> Iterator for &'_ mut I where
I: Iterator + ?Sized, type Item = <I as Iterator>::Item;impl<'_, F> Future for &'_ mut F where
F: Future + Unpin + ?Sized, type Output = <F as Future>::Output;impl<R: Read + ?Sized> Read for &mut Rimpl<W: Write + ?Sized> Write for &mut W