Skip to main content

Dispatch

Trait Dispatch 

Source
pub trait Dispatch<Context: ?Sized = ()>: Composite {
    type Instruction;

    // Required method
    fn dispatch(
        &mut self,
        instruction: &Self::Instruction,
        context: &Context,
    ) -> Result<()>;
}
Expand description

Dispatch a composite instruction to its destination’s crate::Step.

Available with the experimental typed-declarations feature. Implementations select a field route and leaf instruction type from the aggregate instruction and forward the shared context to its authored Step. Context defaults to ().

Required Associated Types§

Source

type Instruction

The aggregate instruction type accepted by this composite.

Required Methods§

Source

fn dispatch( &mut self, instruction: &Self::Instruction, context: &Context, ) -> Result<()>

Select and run the step, borrowing the instruction without consuming it.

§Errors

Returns the selected step’s error unchanged. State changes and effects already applied by the step are not rolled back; recovery or termination is the caller’s responsibility.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§