Skip to main content

CommandImplementation

Trait CommandImplementation 

Source
pub trait CommandImplementation {
    // Required method
    fn check_instantiability(
        _ctx: &CommandSpecification,
        _args: Vec<Type>,
    ) -> Result<Type, Diagnostic>;

    // Provided methods
    fn post_process_evaluated_inputs(
        _ctx: &CommandSpecification,
        inputs: CommandInputsEvaluationResult,
    ) -> InputsPostProcessingFutureResult { ... }
    fn check_executability(
        _construct_id: &ConstructDid,
        _instance_name: &str,
        _spec: &CommandSpecification,
        _values: &ValueStore,
        _supervision_context: &RunbookSupervisionContext,
        _auth_context: &AuthorizationContext,
    ) -> Result<Actions, Diagnostic> { ... }
    fn run_execution(
        _construct_id: &ConstructDid,
        _spec: &CommandSpecification,
        _values: &ValueStore,
        _progress_tx: &Sender<BlockEvent>,
        _auth_context: &AuthorizationContext,
    ) -> CommandExecutionFutureResult { ... }
    fn check_signed_executability(
        _construct_id: &ConstructDid,
        _instance_name: &str,
        _spec: &CommandSpecification,
        _values: &ValueStore,
        _supervision_context: &RunbookSupervisionContext,
        _signers_instances: &HashMap<ConstructDid, SignerInstance>,
        _signers_state: SignersState,
        _auth_ctx: &AuthorizationContext,
    ) -> SignerActionsFutureResult { ... }
    fn prepare_signed_nested_execution(
        construct_did: &ConstructDid,
        instance_name: &str,
        _values: &ValueStore,
        _signers_instances: &HashMap<ConstructDid, SignerInstance>,
        signers_state: SignersState,
    ) -> PrepareSignedNestedExecutionResult { ... }
    fn evaluate_pre_conditions(
        construct_did: &ConstructDid,
        instance_name: &str,
        spec: &CommandSpecification,
        values: &ValueStore,
        progress_tx: &Sender<BlockEvent>,
        background_tasks_uuid: &Uuid,
    ) -> Result<PreConditionEvaluationResult, Diagnostic> { ... }
    fn prepare_nested_execution(
        construct_did: &ConstructDid,
        _instance_name: &str,
        _values: &ValueStore,
    ) -> Result<Vec<(ConstructDid, ValueStore)>, Diagnostic> { ... }
    fn aggregate_nested_execution_results(
        _instance_name: &str,
        _construct_did: &ConstructDid,
        _values: &Vec<(ConstructDid, ValueStore)>,
        nested_results: &Vec<CommandExecutionResult>,
    ) -> Result<CommandExecutionResult, Diagnostic> { ... }
    fn run_signed_execution(
        _construct_id: &ConstructDid,
        _spec: &CommandSpecification,
        _values: &ValueStore,
        _progress_tx: &Sender<BlockEvent>,
        _signers_instances: &HashMap<ConstructDid, SignerInstance>,
        _signers_state: SignersState,
        _auth_context: &AuthorizationContext,
    ) -> SignerSignFutureResult { ... }
    fn build_background_task(
        _construct_did: &ConstructDid,
        _spec: &CommandSpecification,
        _values: &ValueStore,
        _outputs: &ValueStore,
        _progress_tx: &Sender<BlockEvent>,
        _background_tasks_uuid: &Uuid,
        _supervision_context: &RunbookSupervisionContext,
        _cloud_service_context: &Option<CloudServiceContext>,
    ) -> CommandExecutionFutureResult { ... }
    fn evaluate_post_conditions(
        construct_did: &ConstructDid,
        instance_name: &str,
        spec: &CommandSpecification,
        values: &ValueStore,
        execution_results: &mut CommandExecutionResult,
        progress_tx: &Sender<BlockEvent>,
        background_tasks_uuid: &Uuid,
    ) -> Result<PostConditionEvaluationResult, Diagnostic> { ... }
}

Required Methods§

Provided Methods§

Source

fn post_process_evaluated_inputs( _ctx: &CommandSpecification, inputs: CommandInputsEvaluationResult, ) -> InputsPostProcessingFutureResult

Source

fn check_executability( _construct_id: &ConstructDid, _instance_name: &str, _spec: &CommandSpecification, _values: &ValueStore, _supervision_context: &RunbookSupervisionContext, _auth_context: &AuthorizationContext, ) -> Result<Actions, Diagnostic>

Source

fn run_execution( _construct_id: &ConstructDid, _spec: &CommandSpecification, _values: &ValueStore, _progress_tx: &Sender<BlockEvent>, _auth_context: &AuthorizationContext, ) -> CommandExecutionFutureResult

Source

fn check_signed_executability( _construct_id: &ConstructDid, _instance_name: &str, _spec: &CommandSpecification, _values: &ValueStore, _supervision_context: &RunbookSupervisionContext, _signers_instances: &HashMap<ConstructDid, SignerInstance>, _signers_state: SignersState, _auth_ctx: &AuthorizationContext, ) -> SignerActionsFutureResult

Source

fn prepare_signed_nested_execution( construct_did: &ConstructDid, instance_name: &str, _values: &ValueStore, _signers_instances: &HashMap<ConstructDid, SignerInstance>, signers_state: SignersState, ) -> PrepareSignedNestedExecutionResult

Source

fn evaluate_pre_conditions( construct_did: &ConstructDid, instance_name: &str, spec: &CommandSpecification, values: &ValueStore, progress_tx: &Sender<BlockEvent>, background_tasks_uuid: &Uuid, ) -> Result<PreConditionEvaluationResult, Diagnostic>

Source

fn prepare_nested_execution( construct_did: &ConstructDid, _instance_name: &str, _values: &ValueStore, ) -> Result<Vec<(ConstructDid, ValueStore)>, Diagnostic>

Source

fn aggregate_nested_execution_results( _instance_name: &str, _construct_did: &ConstructDid, _values: &Vec<(ConstructDid, ValueStore)>, nested_results: &Vec<CommandExecutionResult>, ) -> Result<CommandExecutionResult, Diagnostic>

Source

fn run_signed_execution( _construct_id: &ConstructDid, _spec: &CommandSpecification, _values: &ValueStore, _progress_tx: &Sender<BlockEvent>, _signers_instances: &HashMap<ConstructDid, SignerInstance>, _signers_state: SignersState, _auth_context: &AuthorizationContext, ) -> SignerSignFutureResult

Source

fn build_background_task( _construct_did: &ConstructDid, _spec: &CommandSpecification, _values: &ValueStore, _outputs: &ValueStore, _progress_tx: &Sender<BlockEvent>, _background_tasks_uuid: &Uuid, _supervision_context: &RunbookSupervisionContext, _cloud_service_context: &Option<CloudServiceContext>, ) -> CommandExecutionFutureResult

Source

fn evaluate_post_conditions( construct_did: &ConstructDid, instance_name: &str, spec: &CommandSpecification, values: &ValueStore, execution_results: &mut CommandExecutionResult, progress_tx: &Sender<BlockEvent>, background_tasks_uuid: &Uuid, ) -> Result<PostConditionEvaluationResult, Diagnostic>

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§