Skip to main content

Executor

Trait Executor 

Source
pub trait Executor {
    type Error: Error + Send + Sync + 'static;

    // Required methods
    fn receipt(&self, draft: &str) -> Result<Option<Execution>, Self::Error>;
    fn execute_and_record(
        &mut self,
        draft: &ApprovedDraft,
    ) -> Result<Execution, Self::Error>;
}
Expand description

An atomic, durable product ledger; the library owns no store or authority.

Required Associated Types§

Source

type Error: Error + Send + Sync + 'static

A product storage or execution failure.

Required Methods§

Source

fn receipt(&self, draft: &str) -> Result<Option<Execution>, Self::Error>

Read the committed outcome before attempting execution.

Source

fn execute_and_record( &mut self, draft: &ApprovedDraft, ) -> Result<Execution, Self::Error>

Atomically apply and record once per draft id; concurrent calls return the same receipt. A stored id with another digest must be refused without applying anything.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§