pub trait PromiseLikeBase<S, R>: Sizedwhere
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§
Required Methods§
Sourcefn 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 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
Sourcefn map_result<R2, F>(self, map: F) -> Self::Promise<S, R2>where
R2: 'static,
F: 'static + FnOnce(R) -> R2,
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
Sourcefn with_result<R2>(self, value: R2) -> Self::Promise<S, R2>where
R2: 'static,
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
Sourcefn map<S2, F>(self, map: F) -> Self::Promise<S2, R>where
S2: 'static,
F: 'static + FnOnce(S) -> S2,
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
Sourcefn with<S2>(self, state: S2) -> Self::Promise<S2, R>where
S2: 'static,
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".