Skip to main content

PromiseLikeBase

Trait PromiseLikeBase 

Source
pub trait PromiseLikeBase<S, R>: Sized
where S: 'static, R: 'static,
{ type Promise<S2: 'static, R2: 'static>; // Required methods fn then<S2, R2>( self, func: Asyn<(PromiseState<S>, R), impl Into<PromiseResult<S2, R2>> + 'static, impl PromiseParams>, ) -> Self::Promise<S2, R2> where S2: 'static, R2: 'static; fn map_result<R2, F>(self, map: F) -> Self::Promise<S, R2> where R2: 'static, F: 'static + FnOnce(R) -> R2; fn with_result<R2>(self, value: R2) -> Self::Promise<S, R2> where R2: 'static; fn map<S2, F>(self, map: F) -> Self::Promise<S2, R> where S2: 'static, F: 'static + FnOnce(S) -> S2; fn with<S2>(self, state: S2) -> Self::Promise<S2, R> where S2: 'static; }

Required Associated Types§

Source

type Promise<S2: 'static, R2: 'static>

Required Methods§

Source

fn then<S2, R2>( self, func: Asyn<(PromiseState<S>, R), impl Into<PromiseResult<S2, R2>> + 'static, impl PromiseParams>, ) -> Self::Promise<S2, R2>
where S2: 'static, R2: 'static,

Schedule the next Asyn![S, R => S2, R2] func invocation after current promise resolve. S2 and R2 infers from the func body

Source

fn map_result<R2, F>(self, map: F) -> Self::Promise<S, R2>
where R2: 'static, F: 'static + FnOnce(R) -> R2,

Create new PromiseLike<S, R> from previouse promise with result mapped by map from R to R2

Source

fn with_result<R2>(self, value: R2) -> Self::Promise<S, R2>
where R2: 'static,

Create new PromiseLike<S, R2> from previouse promise with new result R2

Source

fn map<S2, F>(self, map: F) -> Self::Promise<S2, R>
where S2: 'static, F: 'static + FnOnce(S) -> S2,

Create new PromiseLike<S2, R> from previouse promise with state mapped by map from S to S2

Source

fn with<S2>(self, state: S2) -> Self::Promise<S2, R>
where S2: 'static,

Create new PromiseLike<S2, R> from previouse promise with state replaced with S2

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<'w, 's, 'a, S, F> PromiseLikeBase<S, ()> for PromiseCommands<'w, 's, 'a, F>
where S: 'static, F: FnOnce() -> S,

Source§

type Promise<S2: 'static, R2: 'static> = PromiseChain<'w, 's, 'a, S2, R2>

Source§

impl<'w, 's, 'a, S, R> PromiseLikeBase<S, R> for PromiseChain<'w, 's, 'a, S, R>
where S: 'static, R: 'static,

Source§

type Promise<S2: 'static, R2: 'static> = PromiseChain<'w, 's, 'a, S2, R2>

Source§

impl<'w, 's, 'a, S, R> PromiseLikeBase<S, R> for PromiseCommands<'w, 's, 'a, Promise<S, R>>
where S: 'static, R: 'static,

Source§

type Promise<S2: 'static, R2: 'static> = PromiseChain<'w, 's, 'a, S2, R2>

Source§

impl<S, R> PromiseLikeBase<S, R> for Promise<S, R>
where S: 'static, R: 'static,

Source§

type Promise<S2: 'static, R2: 'static> = Promise<S2, R2>