Skip to main content

Action

Trait Action 

Source
pub trait Action: Send + Sync {
    // Required methods
    fn metadata(&self) -> ActionMetadata;
    fn execute(
        &self,
        step: &StepInfo,
        ctx: &HandlerContext<'_>,
        params: &Value,
        reporter: &mut Reporter<'_>,
        backend: Option<&mut dyn Backend>,
    ) -> Result<StepResult, ActionError>;

    // Provided method
    fn apply_defaults(&self, _params: &mut Value, _step: &StepInfo) { ... }
}
Expand description

Action trait, every ceremony step handler implements this.

Handlers emit facts and prompts through Reporter and return a StepResult. Transcript evidence is whatever facts the handler emits via Reporter::fact during execution; there is no separate evidence struct.

Required Methods§

Source

fn metadata(&self) -> ActionMetadata

Metadata describing this action (type, category, description).

Source

fn execute( &self, step: &StepInfo, ctx: &HandlerContext<'_>, params: &Value, reporter: &mut Reporter<'_>, backend: Option<&mut dyn Backend>, ) -> Result<StepResult, ActionError>

Execute the action.

§Errors

Returns ActionError when the handler cannot complete, when the operator aborts, or when the frontend disappears.

Provided Methods§

Source

fn apply_defaults(&self, _params: &mut Value, _step: &StepInfo)

Apply per-step parameter defaults before validation.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§