ApplicationRunTime

Trait ApplicationRunTime 

Source
pub trait ApplicationRunTime:
    HasEnvironment
    + Send
    + Sync
    + 'static {
    // Required method
    fn Run<'life0, 'async_trait, TCapabilityProvider, TError, TOutput>(
        &'life0 self,
        Effect: ActionEffect<Arc<TCapabilityProvider>, TError, TOutput>,
    ) -> Pin<Box<dyn Future<Output = Result<TOutput, TError>> + Send + 'async_trait>>
       where TCapabilityProvider: ?Sized + Send + Sync + 'static + 'async_trait,
             Self::EnvironmentType: Requires<TCapabilityProvider>,
             TError: From<CommonError> + Send + Sync + 'static + 'async_trait,
             TOutput: Send + Sync + 'static + 'async_trait,
             Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

The core trait for any runtime capable of executing ActionEffects.

Required Methods§

Source

fn Run<'life0, 'async_trait, TCapabilityProvider, TError, TOutput>( &'life0 self, Effect: ActionEffect<Arc<TCapabilityProvider>, TError, TOutput>, ) -> Pin<Box<dyn Future<Output = Result<TOutput, TError>> + Send + 'async_trait>>
where TCapabilityProvider: ?Sized + Send + Sync + 'static + 'async_trait, Self::EnvironmentType: Requires<TCapabilityProvider>, TError: From<CommonError> + Send + Sync + 'static + 'async_trait, TOutput: Send + Sync + 'static + 'async_trait, Self: 'async_trait, 'life0: 'async_trait,

Executes an effect using the environment provided by the runtime.

The runtime is responsible for acquiring the necessary capability from its environment and passing it to the effect’s execution logic.

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.

Implementations on Foreign Types§

Source§

impl<TRunTime: ApplicationRunTime> ApplicationRunTime for Arc<TRunTime>

A blanket implementation that allows a shared Arc of a runtime to also be used as a runtime.

Source§

fn Run<'life0, 'async_trait, TCapabilityProvider, TError, TOutput>( &'life0 self, Effect: ActionEffect<Arc<TCapabilityProvider>, TError, TOutput>, ) -> Pin<Box<dyn Future<Output = Result<TOutput, TError>> + Send + 'async_trait>>
where TCapabilityProvider: ?Sized + Send + Sync + 'static + 'async_trait, Self::EnvironmentType: Requires<TCapabilityProvider>, TError: From<CommonError> + Send + Sync + 'static + 'async_trait, TOutput: Send + Sync + 'static + 'async_trait, Self: 'async_trait, 'life0: 'async_trait,

Implementors§