[−][src]Enum futures::prelude::Poll
pub enum Poll<T> { Ready(T), Pending, }
🔬 This is a nightly-only experimental API. (futures_api
)
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
)
futures in libcore are unstable
Represents that a value is immediately ready.
Pending
🔬 This is a nightly-only experimental API. (futures_api
)
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
)
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
)
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
)
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
)
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
)
futures in libcore are unstable
Change the error value of this Poll
with the closure provided
Trait Implementations
impl<T> Clone for Poll<T> where
T: Clone,
[src]
impl<T> Clone for Poll<T> where
T: Clone,
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> PartialOrd<Poll<T>> for Poll<T> where
T: PartialOrd<T>,
[src]
impl<T> PartialOrd<Poll<T>> for Poll<T> where
T: PartialOrd<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> Ord for Poll<T> where
T: Ord,
[src]
impl<T> Ord for Poll<T> where
T: Ord,
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
1.21.0[src]
fn max(self, other: Self) -> Self
Compares and returns the maximum of two values. Read more
fn min(self, other: Self) -> Self
1.21.0[src]
fn min(self, other: Self) -> Self
Compares and returns the minimum of two values. Read more
impl<T> Eq for Poll<T> where
T: Eq,
[src]
impl<T> Eq for Poll<T> where
T: Eq,
impl<T> PartialEq<Poll<T>> for Poll<T> where
T: PartialEq<T>,
[src]
impl<T> PartialEq<Poll<T>> for Poll<T> where
T: PartialEq<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> From<T> for Poll<T>
[src]
impl<T> From<T> for Poll<T>
impl<T> Copy for Poll<T> where
T: Copy,
[src]
impl<T> Copy for Poll<T> where
T: Copy,
impl<T> Hash for Poll<T> where
T: Hash,
[src]
impl<T> Hash for Poll<T> where
T: Hash,
fn hash<__HT>(&self, state: &mut __HT) where
__HT: Hasher,
[src]
fn hash<__HT>(&self, state: &mut __HT) where
__HT: Hasher,
Feeds this value into the given [Hasher
]. Read more
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
Feeds a slice of this type into the given [Hasher
]. Read more
impl<T, E> Try for Poll<Option<Result<T, E>>>
[src]
impl<T, E> Try for Poll<Option<Result<T, E>>>
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.
fn into_result(
self
) -> Result<<Poll<Option<Result<T, E>>> as Try>::Ok, <Poll<Option<Result<T, E>>> as Try>::Error>
[src]
fn into_result(
self
) -> Result<<Poll<Option<Result<T, E>>> as Try>::Ok, <Poll<Option<Result<T, E>>> as Try>::Error>
try_trait
)Applies the "?" operator. A return of Ok(t)
means that the execution should continue normally, and the result of ?
is the value t
. A return of Err(e)
means that execution should branch to the innermost enclosing catch
, or return from the function. Read more
fn from_error(
e: <Poll<Option<Result<T, E>>> as Try>::Error
) -> Poll<Option<Result<T, E>>>
[src]
fn from_error(
e: <Poll<Option<Result<T, E>>> as Try>::Error
) -> Poll<Option<Result<T, E>>>
try_trait
)Wrap an error value to construct the composite result. For example, Result::Err(x)
and Result::from_error(x)
are equivalent. Read more
fn from_ok(
x: <Poll<Option<Result<T, E>>> as Try>::Ok
) -> Poll<Option<Result<T, E>>>
[src]
fn from_ok(
x: <Poll<Option<Result<T, E>>> as Try>::Ok
) -> Poll<Option<Result<T, E>>>
try_trait
)Wrap an OK value to construct the composite result. For example, Result::Ok(x)
and Result::from_ok(x)
are equivalent. Read more
impl<T, E> Try for Poll<Result<T, E>>
[src]
impl<T, E> Try for Poll<Result<T, E>>
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.
fn into_result(
self
) -> Result<<Poll<Result<T, E>> as Try>::Ok, <Poll<Result<T, E>> as Try>::Error>
[src]
fn into_result(
self
) -> Result<<Poll<Result<T, E>> as Try>::Ok, <Poll<Result<T, E>> as Try>::Error>
try_trait
)Applies the "?" operator. A return of Ok(t)
means that the execution should continue normally, and the result of ?
is the value t
. A return of Err(e)
means that execution should branch to the innermost enclosing catch
, or return from the function. Read more
fn from_error(e: <Poll<Result<T, E>> as Try>::Error) -> Poll<Result<T, E>>
[src]
fn from_error(e: <Poll<Result<T, E>> as Try>::Error) -> Poll<Result<T, E>>
try_trait
)Wrap an error value to construct the composite result. For example, Result::Err(x)
and Result::from_error(x)
are equivalent. Read more
fn from_ok(x: <Poll<Result<T, E>> as Try>::Ok) -> Poll<Result<T, E>>
[src]
fn from_ok(x: <Poll<Result<T, E>> as Try>::Ok) -> Poll<Result<T, E>>
try_trait
)Wrap an OK value to construct the composite result. For example, Result::Ok(x)
and Result::from_ok(x)
are equivalent. Read more
impl<T> Debug for Poll<T> where
T: Debug,
[src]
impl<T> Debug for Poll<T> where
T: Debug,
Auto Trait Implementations
Blanket Implementations
impl<T> From for T
[src]
impl<T> From for T
impl<T, U> TryFrom for T where
T: From<U>,
[src]
impl<T, U> TryFrom for T where
T: From<U>,
type Error = !
try_from
)The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
try_from
)Performs the conversion.
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
try_from
)The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
try_from
)Performs the conversion.
impl<T, U> Into for T where
U: From<T>,
[src]
impl<T, U> Into for T where
U: From<T>,
impl<T> Borrow for T where
T: ?Sized,
[src]
impl<T> Borrow for T where
T: ?Sized,
ⓘImportant traits for &'a mut Ifn borrow(&self) -> &T
[src]
fn borrow(&self) -> &T
Immutably borrows from an owned value. Read more
impl<T> BorrowMut for T where
T: ?Sized,
[src]
impl<T> BorrowMut for T where
T: ?Sized,
ⓘImportant traits for &'a mut Ifn borrow_mut(&mut self) -> &mut T
[src]
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<T> Any for T where
T: 'static + ?Sized,
[src]
impl<T> Any for T where
T: 'static + ?Sized,
fn get_type_id(&self) -> TypeId
[src]
fn get_type_id(&self) -> TypeId
🔬 This is a nightly-only experimental API. (get_type_id
)
this method will likely be replaced by an associated static
Gets the TypeId
of self
. Read more
impl<T> ToOwned for T where
T: Clone,
[src]
impl<T> ToOwned for T where
T: Clone,
type Owned = T
fn to_owned(&self) -> T
[src]
fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
fn clone_into(&self, target: &mut T)
[src]
fn clone_into(&self, target: &mut T)
🔬 This is a nightly-only experimental API. (toowned_clone_into
)
recently added
Uses borrowed data to replace owned data, usually by cloning. Read more