Struct PollFn

#[must_use = "streams do nothing unless polled"]
pub struct PollFn<F> { /* private fields */ }

Stream for the poll_fn function.

Trait Implementations

impl<F> Debug for PollFn<F>

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

impl<F> Unpin for PollFn<F>

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

type Item = T;
fn poll_next(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Option<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<S> TryStreamExt for PollFn<F> where S: TryStream + ?Sized,

impl<S, T, E> TryStream for PollFn<F> where S: Stream<Item = Result<T, E>> + ?Sized,

type Ok = T;
type Error = E;
fn try_poll_next(self: Pin<&mut S>, cx: &mut Context<'_>) -> Poll<Option<Result<<S as TryStream>::Ok, <S as TryStream>::Error>>>

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> StreamExt for PollFn<F> where T: Stream + ?Sized,

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>