Skip to main content

GeneratedCommand

Trait GeneratedCommand 

Source
pub trait GeneratedCommand {
    type Outcome;

    // Required methods
    fn idempotent_command(
        &self,
    ) -> Result<IdempotentCommand, GeneratedCommandError>;
    fn outcome_request(
        &self,
        request_id: RequestId,
    ) -> Result<GetOutcomeRequest, GeneratedCommandError>;
    fn decode_outcome(
        &self,
        response: &ExecuteCommandResponse,
    ) -> Result<Self::Outcome, GeneratedCommandError>;

    // Provided method
    fn workflow_successor_revisions(
        &self,
        _response: &ExecuteCommandResponse,
    ) -> Result<Vec<WorkflowSuccessorRevision>, GeneratedCommandError> { ... }
}
Expand description

One command shape emitted from a checked contract bundle.

Implementations contain only value-shape ergonomics. The server remains authoritative for schema validation and every database guarantee.

Required Associated Types§

Source

type Outcome

The generated declared-outcome enum.

Required Methods§

Source

fn idempotent_command(&self) -> Result<IdempotentCommand, GeneratedCommandError>

Constructs the immutable generic transport command.

Source

fn outcome_request( &self, request_id: RequestId, ) -> Result<GetOutcomeRequest, GeneratedCommandError>

Constructs same-key outcome recovery from this typed command input.

The generated implementation owns the schema binding between the command input’s idempotency field and this recovery request.

Source

fn decode_outcome( &self, response: &ExecuteCommandResponse, ) -> Result<Self::Outcome, GeneratedCommandError>

Decodes a structurally checked Execute response into the generated outcome.

Provided Methods§

Source

fn workflow_successor_revisions( &self, _response: &ExecuteCommandResponse, ) -> Result<Vec<WorkflowSuccessorRevision>, GeneratedCommandError>

Derives compiler-owned successor revisions for successful checked workflow mutations.

Ordinary commands return no revisions. Generated workflow bindings override this method and derive each successor from the exact observed revision that the server accepted. The response outcome gates the derivation, so stale or illegal business outcomes never manufacture a revision.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§