pub struct Strawpoll<F> { /* private fields */ }
Expand description
Polling wrapper that avoids spurious calls to poll
on F
.
Implementations§
source§impl<F> Strawpoll<F>
impl<F> Strawpoll<F>
sourcepub fn poll_fn<P, R>(
self: Pin<&mut Self>,
cx: &mut Context<'_>,
poll_fn: P
) -> Poll<R>where
P: FnMut(Pin<&mut F>, &mut Context<'_>) -> Poll<R>,
pub fn poll_fn<P, R>(
self: Pin<&mut Self>,
cx: &mut Context<'_>,
poll_fn: P
) -> Poll<R>where
P: FnMut(Pin<&mut F>, &mut Context<'_>) -> Poll<R>,
Call poll_fn
with F
pinned only if F
really needs to be polled.
Specifically, poll_fn
will only be called if:
F
has never been polled; orcx
contains a new waker; orF
was woken up.
Trait Implementations§
source§impl<S> Stream for Strawpoll<S>where
S: Stream,
Available on crate feature stream
only.
impl<S> Stream for Strawpoll<S>where
S: Stream,
Available on crate feature
stream
only.impl<F> Unpin for Strawpoll<F>where
F: Unpin,
Auto Trait Implementations§
impl<F> RefUnwindSafe for Strawpoll<F>where
F: RefUnwindSafe,
impl<F> Send for Strawpoll<F>where
F: Send,
impl<F> Sync for Strawpoll<F>where
F: Sync,
impl<F> UnwindSafe for Strawpoll<F>where
F: UnwindSafe,
Blanket Implementations§
source§impl<F> IntoFuture for Fwhere
F: Future,
impl<F> IntoFuture for Fwhere
F: Future,
§type IntoFuture = F
type IntoFuture = F
Which kind of future are we turning this into?
source§fn into_future(self) -> <F as IntoFuture>::IntoFuture
fn into_future(self) -> <F as IntoFuture>::IntoFuture
Creates a future from a value. Read more