TnuaActionSlots

Trait TnuaActionSlots 

Source
pub trait TnuaActionSlots:
    'static
    + Send
    + Sync {
    type Scheme: TnuaScheme;

    const ZEROES: Self;

    // Required methods
    fn rule_for(
        action: <Self::Scheme as TnuaScheme>::ActionDiscriminant,
    ) -> TnuaActionCountingActionRule;
    fn get_mut(
        &mut self,
        action: <Self::Scheme as TnuaScheme>::ActionDiscriminant,
    ) -> Option<&mut usize>;
    fn get(
        &self,
        action: <Self::Scheme as TnuaScheme>::ActionDiscriminant,
    ) -> Option<usize>;
}
Expand description

Required Associated Constants§

Source

const ZEROES: Self

A state where all the slot counters are zeroed.

Required Associated Types§

Source

type Scheme: TnuaScheme

The scheme who’s actions are assigned to the slots.

Required Methods§

Source

fn rule_for( action: <Self::Scheme as TnuaScheme>::ActionDiscriminant, ) -> TnuaActionCountingActionRule

Decision what to do when an action starts.

Source

fn get_mut( &mut self, action: <Self::Scheme as TnuaScheme>::ActionDiscriminant, ) -> Option<&mut usize>

Get a mutable reference to the counter of the action’s slot.

Note that not all actions have slots. For actions not assigned to any slot, this will return None.

Source

fn get( &self, action: <Self::Scheme as TnuaScheme>::ActionDiscriminant, ) -> Option<usize>

Get the value of the counter of the action’s slot.

Note that not all actions have slots. For actions not assigned to any slot, this will return None.

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§