[][src]Enum eff::next_event::NextEvent

pub enum NextEvent<C: Effectful> {
    Computation(C),
    Event(Event<C::Output, C::Effect>),
    Gone,
}

A combinator created by next_event.

This struct polls the given computation until the first event occurs. It's valid to poll again after this computation completes.

Variants

Computation(C)

the computation has not generated an event yet

Event(Event<C::Output, C::Effect>)

An event occured

Gone

The event has been taken by take_event

Methods

impl<C: Effectful> NextEvent<C>[src]

pub fn occured(&self) -> bool[src]

Checks if the underlying computation generated an event

pub fn take_event(self: Pin<&mut Self>) -> Option<Event<C::Output, C::Effect>>[src]

Take the event if occured

Trait Implementations

impl<C: Effectful> Effectful for NextEvent<C>[src]

type Output = ()

The type of the final result

type Effect = !

The type of the effects this computation will produce

Auto Trait Implementations

impl<C> Send for NextEvent<C> where
    C: Send,
    <C as Effectful>::Effect: Send,
    <C as Effectful>::Output: Send

impl<C> Sync for NextEvent<C> where
    C: Sync,
    <C as Effectful>::Effect: Sync,
    <C as Effectful>::Output: Sync

impl<C> Unpin for NextEvent<C> where
    C: Unpin,
    <C as Effectful>::Effect: Unpin,
    <C as Effectful>::Output: Unpin

impl<C> UnwindSafe for NextEvent<C> where
    C: UnwindSafe,
    <C as Effectful>::Effect: UnwindSafe,
    <C as Effectful>::Output: UnwindSafe

impl<C> RefUnwindSafe for NextEvent<C> where
    C: RefUnwindSafe,
    <C as Effectful>::Effect: RefUnwindSafe,
    <C as Effectful>::Output: RefUnwindSafe

Blanket Implementations

impl<T> EmbedRest<T, Zero> for T[src]

impl<Head, Tail, N, Rest> EmbedRest<Either<Head, Tail>, Succ<N>> for Rest where
    Head: Effect,
    Rest: EmbedRest<Tail, N>, 
[src]

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

impl<T> From<T> for 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.

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

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

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