[][src]Struct strawpoll::Strawpoll

pub struct Strawpoll<F> { /* fields omitted */ }

Polling wrapper that avoids spurious calls to poll on F.

Methods

impl<F> Strawpoll<F>[src]

pub fn new(f: F) -> Self[src]

Wrap f to avoid spurious polling on it.

pub fn poll_fn<P, R>(
    self: Pin<&mut Self>,
    cx: &mut Context,
    poll_fn: P
) -> Poll<R> where
    P: FnOnce(Pin<&mut F>, &mut Context) -> Poll<R>, 
[src]

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; or
  • cx contains a new waker; or
  • F was woken up.

Trait Implementations

impl<F: Debug> Debug for Strawpoll<F>[src]

impl<F> Deref for Strawpoll<F>[src]

type Target = F

The resulting type after dereferencing.

impl<F> DerefMut for Strawpoll<F>[src]

impl<F> From<F> for Strawpoll<F>[src]

impl<F> Future for Strawpoll<F> where
    F: Future
[src]

type Output = F::Output

The type of value produced on completion.

impl<F> Unpin for Strawpoll<F> where
    F: Unpin
[src]

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

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<!> for T[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.