Skip to main content

SuitSharedSequenceHandler

Trait SuitSharedSequenceHandler 

Source
pub trait SuitSharedSequenceHandler {
    // Required methods
    fn on_conditions<'a>(
        &mut self,
        conditions: impl Iterator<Item = PairView<'a, SuitCondition>>,
    ) -> Result<(), SuitError>;
    fn on_commands<'a>(
        &mut self,
        commands: impl Iterator<Item = PairView<'a, SuitSharedCommand<'a>>>,
    ) -> Result<(), SuitError>;
}
Expand description

Handler trait to treat a SuitShareCommand Sequence. You can specify the comportement for each SuitCommandSequence type (SuitCondition, SuitDirective).

This handler will be lazy applicated to the corresponding variant. If you wanna customize the behaviour with PairView inspection before decoding it you can implement this trait by yourself.

Else if you wnat a generic handler you can directly use the GenericSharedSequenceHandler.

Required Methods§

Source

fn on_conditions<'a>( &mut self, conditions: impl Iterator<Item = PairView<'a, SuitCondition>>, ) -> Result<(), SuitError>

Source

fn on_commands<'a>( &mut self, commands: impl Iterator<Item = PairView<'a, SuitSharedCommand<'a>>>, ) -> Result<(), SuitError>

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§

Source§

impl<FCond, FCom> SuitSharedSequenceHandler for GenericSharedSequenceHandler<FCond, FCom>
where FCond: Fn(&SuitCondition), FCom: Fn(&SuitSharedCommand<'_>),