Struct eager_futures::Eager[][src]

pub struct Eager<'a, T>(pub Rc<RefCell<StateAndData<'a, T, dyn Any + 'a>>>);

An eager future representing an asynchronous value.

Implementations

impl<'a, T> Eager<'a, T>[src]

pub fn new() -> Self[src]

Create a new eager future. Intended to be used by I/O operation implementers.

pub fn set_no_handler(&self)[src]

Setup the eager future so that when it completes, discard the result and do nothing.

pub fn set_handler(&self, handler: impl FnOnce(T) + 'a)[src]

Setup the eager future so that when it completes, call the supplied handler.

pub fn on_complete(&self, result: T)[src]

Complete the eager future. Intended to be used by I/O operation implementers.

pub fn map<To, F>(&self, func: F) -> Eager<'a, To> where
    To: 'a,
    F: FnOnce(T) -> To + 'a, 
[src]

Transform the result of this eager future by the computation defined by func.

pub fn then<To, F>(&self, func: F) -> Eager<'a, To> where
    To: 'a,
    F: FnOnce(T) -> Eager<'a, To> + 'a, 
[src]

Chain another operation defined by func after this eager future completes.

Trait Implementations

impl<'a, T> Clone for Eager<'a, T>[src]

Auto Trait Implementations

impl<'a, T> !RefUnwindSafe for Eager<'a, T>

impl<'a, T> !Send for Eager<'a, T>

impl<'a, T> !Sync for Eager<'a, T>

impl<'a, T> Unpin for Eager<'a, T>

impl<'a, T> !UnwindSafe for Eager<'a, T>

Blanket Implementations

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

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<T> for T[src]

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

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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.