#[repr(C)]pub struct ConditionalLayer {
pub then_layer: LayerIndex,
pub if_layers: LayerBitset,
}Expand description
Conditional layer rule: activate Self::then_layer while every layer in Self::if_layers is active.
Layer indices are 1-based (same as ModifierKey). Bit i of
Self::if_layers corresponds to layer i (same layout as ModifierBitset).
Fields§
§then_layer: LayerIndexLayer activated while the condition holds.
if_layers: LayerBitsetBitset of layers that must all be active.
Implementations§
Source§impl ConditionalLayer
impl ConditionalLayer
Sourcepub const fn new(then_layer: LayerIndex, if_layers: LayerBitset) -> Self
pub const fn new(then_layer: LayerIndex, if_layers: LayerBitset) -> Self
Constructs a rule from a then-layer and an if-layers bitset.
Sourcepub const fn from_if_layers(
then_layer: LayerIndex,
if_layers: &[LayerIndex],
) -> Self
pub const fn from_if_layers( then_layer: LayerIndex, if_layers: &[LayerIndex], ) -> Self
Constructs a rule from a then-layer and if-layer indices.
Trait Implementations§
Source§impl Clone for ConditionalLayer
impl Clone for ConditionalLayer
Source§fn clone(&self) -> ConditionalLayer
fn clone(&self) -> ConditionalLayer
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ConditionalLayer
impl Debug for ConditionalLayer
Source§impl<'de> Deserialize<'de> for ConditionalLayer
impl<'de> Deserialize<'de> for ConditionalLayer
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for ConditionalLayer
impl PartialEq for ConditionalLayer
Source§fn eq(&self, other: &ConditionalLayer) -> bool
fn eq(&self, other: &ConditionalLayer) -> bool
Tests for
self and other values to be equal, and is used by ==.impl Copy for ConditionalLayer
impl Eq for ConditionalLayer
impl StructuralPartialEq for ConditionalLayer
Auto Trait Implementations§
impl Freeze for ConditionalLayer
impl RefUnwindSafe for ConditionalLayer
impl Send for ConditionalLayer
impl Sync for ConditionalLayer
impl Unpin for ConditionalLayer
impl UnsafeUnpin for ConditionalLayer
impl UnwindSafe for ConditionalLayer
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