use crate::utilities::*;
pub const MAX_COUNT: usize = 6;
#[derive(PartialEq, Eq, Copy, Clone, Debug)]
pub enum Emit<Payload: DataLike> {
Immediate(Payload, usize),
Unordered(Payload, usize),
Ordered(Payload, usize),
ImmediateReplacement(fn(Option<Payload>) -> bool, Payload, usize),
UnorderedReplacement(fn(Option<Payload>) -> bool, Payload, usize),
OrderedReplacement(fn(Option<Payload>) -> bool, Payload, usize),
}
#[derive(PartialEq, Eq, Copy, Clone, Debug)]
pub enum Action<State: KeyLike, Payload: DataLike> {
Defer,
Ignore,
Change(State),
Send1(Emit<Payload>),
ChangeAndSend1(State, Emit<Payload>),
Sends([Option<Emit<Payload>>; MAX_COUNT]),
ChangeAndSends(State, [Option<Emit<Payload>>; MAX_COUNT]),
}
#[derive(PartialEq, Eq, Debug)]
pub enum Activity<Payload: DataLike> {
Passive,
Process1(Payload),
Process1Of([Option<Payload>; MAX_COUNT]),
}
#[derive(PartialEq, Eq, Debug)]
pub enum Reaction<State: KeyLike, Payload: DataLike> {
Unexpected,
Defer,
Ignore,
Do1(Action<State, Payload>),
Do1Of([Option<Action<State, Payload>>; MAX_COUNT]),
}