[][src]Trait sealrs::futures::promise::Promise

pub trait Promise<V: Send + Clone, E: Send + Clone> {
    fn try_complete(&mut self, result: Result<V, E>) -> bool;
fn future(&self) -> WrappedFuture<V, E>; fn complete(&mut self, result: Result<V, E>) -> bool { ... }
fn success(&mut self, value: V) -> bool { ... }
fn failure(&mut self, cause: E) -> bool { ... } }

Required methods

fn try_complete(&mut self, result: Result<V, E>) -> bool

Implementation of this method must try to complete future

fn future(&self) -> WrappedFuture<V, E>

Returns copy of the inner future as wrapper object

Loading content...

Provided methods

fn complete(&mut self, result: Result<V, E>) -> bool

Completes promise with some result. Attention, promise may be completed only once and repeat attempt to do this will cause to panic!

fn success(&mut self, value: V) -> bool

Completes promise with success result

fn failure(&mut self, cause: E) -> bool

Completes promise with failed result

Loading content...

Implementors

impl<V: Send + Clone, E: Send + Clone> Promise<V, E> for AsyncPromise<V, E>[src]

impl<V: Send + Clone, E: Send + Clone> Promise<V, E> for CompletablePromise<V, E>[src]

Loading content...