Trait orchestrator::memory::StateMemory

source ·
pub trait StateMemory<S: ExecutorGlobalState> {
    // Required methods
    fn enable_executor<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        input: &'life1 S,
        output: &'life2 S,
        data: String,
    ) -> Pin<Box<dyn Future<Output = Result<(), Box<dyn Error + Send + Sync + 'static>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait;
    fn get_execution_plan<'life0, 'life1, 'async_trait>(
        &'life0 self,
        input: &'life1 S,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<(TypeId, TypeId, String)>, Box<dyn Error + Send + Sync + 'static>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn add_exercise<'life0, 'async_trait>(
        &'life0 self,
        name: String,
        exercise_type: S,
        source: String,
    ) -> Pin<Box<dyn Future<Output = Result<(), Box<dyn Error + Send + Sync + 'static>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn get_exercise<'life0, 'async_trait>(
        &'life0 self,
        name: String,
    ) -> Pin<Box<dyn Future<Output = Result<(TypeId, String), Box<dyn Error + Send + Sync + 'static>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

This is the trait that contains all method of the memory that does require knowing the state. Is not always available

Required Methods§

source

fn enable_executor<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, input: &'life1 S, output: &'life2 S, data: String, ) -> Pin<Box<dyn Future<Output = Result<(), Box<dyn Error + Send + Sync + 'static>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

used to enable a particular executor

source

fn get_execution_plan<'life0, 'life1, 'async_trait>( &'life0 self, input: &'life1 S, ) -> Pin<Box<dyn Future<Output = Result<Vec<(TypeId, TypeId, String)>, Box<dyn Error + Send + Sync + 'static>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

from a particular state, which executor will be triggered? in which order?

source

fn add_exercise<'life0, 'async_trait>( &'life0 self, name: String, exercise_type: S, source: String, ) -> Pin<Box<dyn Future<Output = Result<(), Box<dyn Error + Send + Sync + 'static>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

add an exercise to memory

source

fn get_exercise<'life0, 'async_trait>( &'life0 self, name: String, ) -> Pin<Box<dyn Future<Output = Result<(TypeId, String), Box<dyn Error + Send + Sync + 'static>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

get an exercise from memory type, source

Implementors§