Struct std::future::PollFn
pub struct PollFn<F> { /* fields omitted */ }
A Future that wraps a function returning Poll
.
This struct
is created by poll_fn()
. See its documentation for more.
Trait Implementations
impl<F> Debug for PollFn<F>
pub fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>
Formats the value using the given formatter. Read more
type Output = T
The type of value produced on completion.
pub fn poll(self: Pin<&mut PollFn<F>>, cx: &mut Context<'_>) -> Poll<T>
Attempt to resolve the future to a final value, registering the current task for wakeup if the value is not yet available. Read more
impl<F> Unpin for PollFn<F>
Auto Trait Implementations
impl<F> RefUnwindSafe for PollFn<F> where
F: RefUnwindSafe,
impl<F> Send for PollFn<F> where
F: Send,
impl<F> Sync for PollFn<F> where
F: Sync,
impl<F> UnwindSafe for PollFn<F> where
F: UnwindSafe,
Blanket Implementations
impl<T> From<T> for T
pub fn from(t: T) -> T
Performs the conversion.
pub fn into(self) -> U
Performs the conversion.
type Output = <F as Future>::Output
The output that the future will produce on completion.
type Future = F
Which kind of future are we turning this into?
pub fn into_future(self) -> <F as IntoFuture>::Future
Creates a future from a value.
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
Performs the conversion.
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
Performs the conversion.
© 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/future/struct.PollFn.html