pub trait Moment:
Send
+ Sync
+ Sized
+ Clone {
type Value: Moment;
// Required method
fn resolve<'async_trait>(
self,
) -> Pin<Box<dyn Future<Output = Self::Value> + Send + 'async_trait>>
where Self: 'async_trait;
}Expand description
A unit of work that can be resolved into a value.
Any type that implements Moment can be stacked with
other Moments to create a calculation. The calculation
can be resolved in parallel, even when the Moments
depend on the output of each other.
Required Associated Types§
Required Methods§
Sourcefn resolve<'async_trait>(
self,
) -> Pin<Box<dyn Future<Output = Self::Value> + Send + 'async_trait>>where
Self: 'async_trait,
fn resolve<'async_trait>(
self,
) -> Pin<Box<dyn Future<Output = Self::Value> + Send + 'async_trait>>where
Self: 'async_trait,
Resolve this Moment into its value.
This will resolve any dependencies of this Moment
and then resolve this Moment into its value. If
this Moment has no dependencies, it will resolve
immediately.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.