pub struct Context<const LAYER_COUNT: usize, const CONDITIONAL_LAYER_COUNT: usize = 0> { /* private fields */ }Expand description
crate::key::Context for LayeredKey that tracks active layers.
Implementations§
Source§impl<const LAYER_COUNT: usize, const CONDITIONAL_LAYER_COUNT: usize> Context<LAYER_COUNT, CONDITIONAL_LAYER_COUNT>
impl<const LAYER_COUNT: usize, const CONDITIONAL_LAYER_COUNT: usize> Context<LAYER_COUNT, CONDITIONAL_LAYER_COUNT>
Sourcepub const fn from_config(
config: Config<CONDITIONAL_LAYER_COUNT>,
) -> Context<LAYER_COUNT, CONDITIONAL_LAYER_COUNT>
pub const fn from_config( config: Config<CONDITIONAL_LAYER_COUNT>, ) -> Context<LAYER_COUNT, CONDITIONAL_LAYER_COUNT>
Constructs a context from the given config.
Source§impl<const LAYER_COUNT: usize, const CONDITIONAL_LAYER_COUNT: usize> Context<LAYER_COUNT, CONDITIONAL_LAYER_COUNT>
impl<const LAYER_COUNT: usize, const CONDITIONAL_LAYER_COUNT: usize> Context<LAYER_COUNT, CONDITIONAL_LAYER_COUNT>
Sourcepub fn layer_state(&self) -> &[Activity; LAYER_COUNT]
pub fn layer_state(&self) -> &[Activity; LAYER_COUNT]
Get the active layers.
Trait Implementations§
Source§impl<const LAYER_COUNT: usize, const CONDITIONAL_LAYER_COUNT: usize> Clone for Context<LAYER_COUNT, CONDITIONAL_LAYER_COUNT>
impl<const LAYER_COUNT: usize, const CONDITIONAL_LAYER_COUNT: usize> Clone for Context<LAYER_COUNT, CONDITIONAL_LAYER_COUNT>
Source§impl<const LAYER_COUNT: usize, const CONDITIONAL_LAYER_COUNT: usize> Context for Context<LAYER_COUNT, CONDITIONAL_LAYER_COUNT>
impl<const LAYER_COUNT: usize, const CONDITIONAL_LAYER_COUNT: usize> Context for Context<LAYER_COUNT, CONDITIONAL_LAYER_COUNT>
Source§type Event = LayerEvent
type Event = LayerEvent
The type of
Event the context handles.Source§impl<const LAYER_COUNT: usize, const CONDITIONAL_LAYER_COUNT: usize> Debug for Context<LAYER_COUNT, CONDITIONAL_LAYER_COUNT>
impl<const LAYER_COUNT: usize, const CONDITIONAL_LAYER_COUNT: usize> Debug for Context<LAYER_COUNT, CONDITIONAL_LAYER_COUNT>
Source§impl<const LAYER_COUNT: usize, const CONDITIONAL_LAYER_COUNT: usize> Default for Context<LAYER_COUNT, CONDITIONAL_LAYER_COUNT>
impl<const LAYER_COUNT: usize, const CONDITIONAL_LAYER_COUNT: usize> Default for Context<LAYER_COUNT, CONDITIONAL_LAYER_COUNT>
impl<const LAYER_COUNT: usize, const CONDITIONAL_LAYER_COUNT: usize> Copy for Context<LAYER_COUNT, CONDITIONAL_LAYER_COUNT>
Auto Trait Implementations§
impl<const LAYER_COUNT: usize, const CONDITIONAL_LAYER_COUNT: usize> Freeze for Context<LAYER_COUNT, CONDITIONAL_LAYER_COUNT>
impl<const LAYER_COUNT: usize, const CONDITIONAL_LAYER_COUNT: usize> RefUnwindSafe for Context<LAYER_COUNT, CONDITIONAL_LAYER_COUNT>
impl<const LAYER_COUNT: usize, const CONDITIONAL_LAYER_COUNT: usize> Send for Context<LAYER_COUNT, CONDITIONAL_LAYER_COUNT>
impl<const LAYER_COUNT: usize, const CONDITIONAL_LAYER_COUNT: usize> Sync for Context<LAYER_COUNT, CONDITIONAL_LAYER_COUNT>
impl<const LAYER_COUNT: usize, const CONDITIONAL_LAYER_COUNT: usize> Unpin for Context<LAYER_COUNT, CONDITIONAL_LAYER_COUNT>
impl<const LAYER_COUNT: usize, const CONDITIONAL_LAYER_COUNT: usize> UnsafeUnpin for Context<LAYER_COUNT, CONDITIONAL_LAYER_COUNT>
impl<const LAYER_COUNT: usize, const CONDITIONAL_LAYER_COUNT: usize> UnwindSafe for Context<LAYER_COUNT, CONDITIONAL_LAYER_COUNT>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more