Skip to main content

dope_sys/table/token/
context.rs

1use std::num;
2
3use o3::base::num::bounded;
4
5/// Typed route identities used by native completion controls.
6pub trait Context: Copy + Eq {
7    type Slot: Copy + Eq + Into<num::NonZero<u32>> + From<bounded::U32<0, 0xff_ffff>>;
8    type Control: Copy + Eq + Into<num::NonZero<u64>> + TryFrom<u64, Error = u64>;
9
10    const ZERO: Self::Slot;
11    const SHUTDOWN: Self::Control;
12
13    fn control(kind: u8, slot: Self::Slot) -> Self::Control;
14}