Skip to main content

CeremonyEngineApi

Trait CeremonyEngineApi 

Source
pub trait CeremonyEngineApi: Send + Sync {
    // Required methods
    fn capabilities(&self) -> ApiCapabilities;
    fn ceremonies<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<CeremonySummary>, ApiError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn ceremony<'life0, 'life1, 'async_trait>(
        &'life0 self,
        ceremony_id: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = Result<CeremonySummary, ApiError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn start_ceremony<'life0, 'async_trait>(
        &'life0 self,
        request: StartCeremonyRequest,
    ) -> Pin<Box<dyn Future<Output = Result<CeremonySummary, ApiError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn start_budgeted_ceremony<'life0, 'async_trait>(
        &'life0 self,
        request: StartCeremonyRequest,
        limits: BudgetLimits,
    ) -> Pin<Box<dyn Future<Output = Result<CeremonySummary, ApiError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn budget_report<'life0, 'life1, 'async_trait>(
        &'life0 self,
        ceremony_id: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = Result<BudgetReport, ApiError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn pending_budget_reservations<'life0, 'life1, 'async_trait>(
        &'life0 self,
        after_reservation_id: Option<&'life1 str>,
        limit: usize,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<BudgetReservation>, ApiError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn raise_intervention<'life0, 'async_trait>(
        &'life0 self,
        request: RaiseInterventionRequest,
    ) -> Pin<Box<dyn Future<Output = Result<CeremonySummary, ApiError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn respond_to_intervention<'life0, 'async_trait>(
        &'life0 self,
        request: RespondToInterventionRequest,
    ) -> Pin<Box<dyn Future<Output = Result<CeremonySummary, ApiError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn analyze_definition<'life0, 'life1, 'async_trait>(
        &'life0 self,
        definition_yaml: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = Result<DefinitionAnalysisView, ApiError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn publish_definition<'life0, 'life1, 'async_trait>(
        &'life0 self,
        definition_yaml: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = Result<PublishedDefinitionView, ApiError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
}
Expand description

What a consuming product may ask of the embedded engine.

Reads, plus one mutation: starting an instance from a published definition. Advancing and publishing stay behind the engine’s own surfaces, where their transactionality and audit live; the contract grows by adding named capabilities, never by widening what an existing one means (ADR-004). A consumer checks the capability report before relying on any of this — and keeps working, with a stub, when the engine is absent.

Required Methods§

Source

fn capabilities(&self) -> ApiCapabilities

What this implementation is and what it can do. Checked by consumers at startup, before anything is at stake.

Source

fn ceremonies<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<Vec<CeremonySummary>, ApiError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Every ceremony instance the engine holds.

The consumer filters by its own context keys; the engine does not know what they mean and is not asked to.

Source

fn ceremony<'life0, 'life1, 'async_trait>( &'life0 self, ceremony_id: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<CeremonySummary, ApiError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

One ceremony instance by identity.

Source

fn start_ceremony<'life0, 'async_trait>( &'life0 self, request: StartCeremonyRequest, ) -> Pin<Box<dyn Future<Output = Result<CeremonySummary, ApiError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Start an instance from a published definition. Capability start_ceremony.

CeremonyNotFound when nothing is published under that name and version — publishing is the remedy, not retrying. A taken instance identity is Refused: an identity is one instance forever, and the answer is a new identity, never a restart of someone else’s.

Source

fn start_budgeted_ceremony<'life0, 'async_trait>( &'life0 self, request: StartCeremonyRequest, limits: BudgetLimits, ) -> Pin<Box<dyn Future<Output = Result<CeremonySummary, ApiError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Start a published ceremony and open one durable budget account shared by its descendants.

Source

fn budget_report<'life0, 'life1, 'async_trait>( &'life0 self, ceremony_id: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<BudgetReport, ApiError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Current durable budget balance for a ceremony tree.

Source

fn pending_budget_reservations<'life0, 'life1, 'async_trait>( &'life0 self, after_reservation_id: Option<&'life1 str>, limit: usize, ) -> Pin<Box<dyn Future<Output = Result<Vec<BudgetReservation>, ApiError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Bounded global recovery view of reservations awaiting a terminal receipt.

Source

fn raise_intervention<'life0, 'async_trait>( &'life0 self, request: RaiseInterventionRequest, ) -> Pin<Box<dyn Future<Output = Result<CeremonySummary, ApiError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Put a question, investigation or proposed action to the table. Capability raise_intervention.

Source

fn respond_to_intervention<'life0, 'async_trait>( &'life0 self, request: RespondToInterventionRequest, ) -> Pin<Box<dyn Future<Output = Result<CeremonySummary, ApiError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Answer an open intervention. Capability respond_to_intervention.

A closed intervention refuses: the answer arrived after the table moved on, and recording it as if it had been heard would misstate the conversation the audit trail exists to keep.

Source

fn analyze_definition<'life0, 'life1, 'async_trait>( &'life0 self, definition_yaml: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<DefinitionAnalysisView, ApiError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Analyze a definition draft, reporting every defect at once. Capability analyze_definition.

A draft that does not even parse is Refused — it is not a defective definition, it is not a definition. Anything that parses gets the full report, publishable or not.

Source

fn publish_definition<'life0, 'life1, 'async_trait>( &'life0 self, definition_yaml: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<PublishedDefinitionView, ApiError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Publish a definition, immutably. Capability publish_definition.

Idempotent on identical content: republishing the same bytes under the same name and version answers already_published rather than refusing, which is what makes a retry safe. A version taken by different content is Refused — a published version is immutable, and the answer is a new version, never an overwrite.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§