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§
Required Methods§
Sourcefn receipt(&self, draft: &str) -> Result<Option<Execution>, Self::Error>
fn receipt(&self, draft: &str) -> Result<Option<Execution>, Self::Error>
Read the committed outcome before attempting execution.
Sourcefn execute_and_record(
&mut self,
draft: &ApprovedDraft,
) -> Result<Execution, Self::Error>
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".