[][src]Struct sealrs::futures::future::Future

pub struct Future<V: Send + 'static, E: Send + Clone + 'static> {
    pub value: Option<Result<V, E>>,
    // some fields omitted
}

Fields

value: Option<Result<V, E>>

Methods

impl<V: Send + Clone, E: Send + Clone> Future<V, E>[src]

pub fn asyncp<F>(f: F, executor: TSafe<dyn Executor>) -> WrappedFuture<V, E> where
    F: FnMut() -> Result<V, E> + Send + 'static, 
[src]

Syntactic sugar for creating of AsyncPromise and extracting it's future

pub fn ok(value: V) -> WrappedFuture<V, E>[src]

Creates already completed future with Ok result

pub fn err(err: E) -> WrappedFuture<V, E>[src]

Creates already completed future with Err result

pub fn new() -> Future<V, E>[src]

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

Return current completion state

pub fn complete(&mut self, result: Result<V, E>)[src]

Fills the value of the futures. This function is called from the promise of which the future belongs and it should never be called by the application code, otherwise it will lead to a breakdown of the future execution logic.

pub fn map<S>(
    &mut self,
    f: Box<dyn FnMut(&V) -> Result<S, E> + Send>
) -> WrappedFuture<S, E> where
    S: Send + Clone + 'static, 
[src]

See mirror in WrappedFuture

pub fn recover(
    &mut self,
    f: Box<dyn FnMut(&E) -> Result<V, E> + Send>
) -> WrappedFuture<V, E>
[src]

See mirror in WrappedFuture

pub fn flat_map<S>(
    &mut self,
    f: Box<dyn FnMut(&V) -> Result<WrappedFuture<S, E>, E> + Send>
) -> WrappedFuture<S, E> where
    S: Send + Clone + 'static, 
[src]

See mirror in WrappedFuture

pub fn map_err<X>(
    &mut self,
    f: Box<dyn FnMut(&E) -> Result<V, X> + Send>
) -> WrappedFuture<V, X> where
    X: Send + Clone + 'static, 
[src]

pub fn on_complete(&mut self, f: Box<dyn FnMut(&Result<V, E>) + Send>)[src]

See mirror in WrappedFuture

pub fn ready(&mut self, _timeout: Duration) -> Result<(), Receiver<bool>>[src]

Returns Ok if future is completed of channel wich will be filled when future will be completed

Auto Trait Implementations

impl<V, E> !Sync for Future<V, E>

impl<V, E> Unpin for Future<V, E> where
    E: Unpin,
    V: Unpin

impl<V, E> Send for Future<V, E>

impl<V, E> !UnwindSafe for Future<V, E>

impl<V, E> !RefUnwindSafe for Future<V, E>

Blanket Implementations

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]