Skip to main content

TurnConsequences

Trait TurnConsequences 

Source
pub trait TurnConsequences: Send + Sync {
    // Required method
    fn following<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        actor: &'life1 ActorContext,
        batches: &'life2 [CommandBatch<Value>],
    ) -> Pin<Box<dyn Future<Output = Result<Vec<CommandBatch<Value>>, StoreError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait;
}
Expand description

What a turn’s writes imply on OTHER cases (spec §23 step M).

Every hook that compiles a command sees one case, so «a fact that becomes true of case A settles a question on case B» has only the application to say it. Asked once per turn, after reduction, with the batches the turn carries; what it returns executes in the same turn under the same journal and idempotency rules. It sees writes, never words, so a consequence holds whether the turn came from a sentence, a click or a replay; and it is not asked again about its own answer.

Required Methods§

Source

fn following<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, actor: &'life1 ActorContext, batches: &'life2 [CommandBatch<Value>], ) -> Pin<Box<dyn Future<Output = Result<Vec<CommandBatch<Value>>, StoreError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

The commands batches imply on other cases, or none.

§Errors

StoreError when the application could not read what it needed. The turn fails rather than executing half a rule.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§