Struct PollFn

#[must_use = "futures do nothing unless you `.await` or poll them"]
pub struct PollFn<F> { pub(in ::future::poll_fn) f: F }

A Future that wraps a function returning Poll.

This struct is created by [poll_fn()]. See its documentation for more.

Fields

f: F

Trait Implementations

impl<F> Debug for PollFn<F>

fn fmt(&self, f: &mut Formatter<'_>) -> Result

impl<F: Unpin> Unpin for PollFn<F>

impl<T, F> Future for PollFn<F> where F: FnMut(&mut Context<'_>) -> Poll<T>,

type Output = T;
fn poll(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<T>

Auto Trait Implementations

impl<F> Freeze for PollFn<F> where F: Freeze,

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> UnsafeUnpin for PollFn<F> where F: UnsafeUnpin,

impl<F> UnwindSafe for PollFn<F> where F: UnwindSafe,

Blanket Implementations

impl<F> IntoFuture for PollFn<F> where F: Future,

type Output = <F as Future>::Output;
type IntoFuture = F;
fn into_future(self) -> <F as IntoFuture>::IntoFuture

impl<T> Any for PollFn<F> where T: 'static + ?Sized,

fn type_id(&self) -> TypeId

impl<T> Borrow<T> for PollFn<F> where T: ?Sized,

fn borrow(&self) -> &T

impl<T> BorrowMut<T> for PollFn<F> where T: ?Sized,

fn borrow_mut(&mut self) -> &mut T

impl<T> From<T> for PollFn<F>

fn from(t: T) -> T

Returns the argument unchanged.

impl<T> SizeHint for PollFn<F> where T: ?Sized,

fn lower_bound(&self) -> usize
fn upper_bound(&self) -> Option<usize>

impl<T> SizedTypeProperties for PollFn<F>

impl<T, U> Into<U> for PollFn<F> where U: From<T>,

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of [From]<T> for U chooses to do.

impl<T, U> TryFrom<U> for PollFn<F> where U: Into<T>,

type Error = never;
fn try_from(value: U) -> Result<T, never>

impl<T, U> TryInto<U> for PollFn<F> where U: TryFrom<T>,

type Error = <U as TryFrom<T>>::Error;
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>