ActivityModifier

Trait ActivityModifier 

Source
pub trait ActivityModifier<State, FromAction> {
    type ModifiedAction;
    type ModifiedActionError;
    type ModifiedChoices<'a>: IntoIterator<Item = Result<(Self::ModifiedAction, State), Self::ModifiedActionError>>
       where Self: 'a,
             Self::ModifiedAction: 'a,
             Self::ModifiedActionError: 'a,
             State: 'a,
             FromAction: 'a;

    // Required method
    fn modify_action<'a>(
        &'a self,
        from_state: State,
        from_action: FromAction,
        to_state: State,
    ) -> Self::ModifiedChoices<'a>
       where FromAction: 'a,
             State: 'a;
}
Expand description

The ActivityModifier can be used to change the behaviors of an activity, e.g. by enforcing constraints.

Required Associated Types§

Source

type ModifiedAction

What kind of action can be output by this modifier

Source

type ModifiedActionError

What kind of error can happen for this modifier

Source

type ModifiedChoices<'a>: IntoIterator<Item = Result<(Self::ModifiedAction, State), Self::ModifiedActionError>> where Self: 'a, Self::ModifiedAction: 'a, Self::ModifiedActionError: 'a, State: 'a, FromAction: 'a

Required Methods§

Source

fn modify_action<'a>( &'a self, from_state: State, from_action: FromAction, to_state: State, ) -> Self::ModifiedChoices<'a>
where FromAction: 'a, State: 'a,

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.

Implementations on Foreign Types§

Source§

impl<State, FromAction> ActivityModifier<State, FromAction> for ()

Source§

type ModifiedAction = FromAction

Source§

type ModifiedActionError = NoError

Source§

type ModifiedChoices<'a> = [Result<(FromAction, State), NoError>; 1] where FromAction: 'a, State: 'a

Source§

fn modify_action<'a>( &'a self, _: State, from_action: FromAction, to_state: State, ) -> Self::ModifiedChoices<'a>
where FromAction: 'a, State: 'a,

Implementors§