[][src]Trait input_linux::bitmask::BitmaskTrait

pub trait BitmaskTrait {
    type Array: Sized;
    type Index: Copy + IterableEnum;

    pub const ZERO: Self::Array;

    pub fn array_default() -> Self::Array;
pub fn array_slice(array: &Self::Array) -> &[u8];
pub fn array_slice_mut(array: &mut Self::Array) -> &mut [u8];
pub fn index(index: Self::Index) -> usize; pub fn index_valid(_array: &Self::Array, _index: Self::Index) -> bool { ... } }

A generic trait that can be used to index by a given type into a set of bits.

Associated Types

type Array: Sized[src]

The underlying array storage data type.

type Index: Copy + IterableEnum[src]

The type that the bitmask can be indexed by.

Loading content...

Associated Constants

pub const ZERO: Self::Array[src]

Empty default data.

Loading content...

Required methods

pub fn array_default() -> Self::Array[src]

The default empty state of the bitmask.

pub fn array_slice(array: &Self::Array) -> &[u8][src]

A representation of the bitmask as a slice of bytes.

pub fn array_slice_mut(array: &mut Self::Array) -> &mut [u8][src]

A mutable representation of the bitmask as a slice of bytes.

pub fn index(index: Self::Index) -> usize[src]

Computes a normalized index value.

Loading content...

Provided methods

pub fn index_valid(_array: &Self::Array, _index: Self::Index) -> bool[src]

Validates whether a given index is valid and in range for the bitmask.

Dynamically allocated bitmasks may not be large enough to contain all indices.

Loading content...

Implementations on Foreign Types

impl BitmaskTrait for Vec<u8>[src]

type Array = Self

type Index = u16

Loading content...

Implementors

impl BitmaskTrait for AbsoluteAxis[src]

type Array = [u8; 8]

type Index = AbsoluteAxis

impl BitmaskTrait for AutorepeatKind[src]

type Array = [u8; 1]

type Index = AutorepeatKind

impl BitmaskTrait for EventKind[src]

type Array = [u8; 4]

type Index = EventKind

impl BitmaskTrait for InputProperty[src]

type Array = [u8; 4]

type Index = InputProperty

impl BitmaskTrait for Key[src]

type Array = [u8; 96]

type Index = Key

impl BitmaskTrait for LedKind[src]

type Array = [u8; 2]

type Index = LedKind

impl BitmaskTrait for MiscKind[src]

type Array = [u8; 1]

type Index = MiscKind

impl BitmaskTrait for RelativeAxis[src]

type Array = [u8; 2]

type Index = RelativeAxis

impl BitmaskTrait for SoundKind[src]

type Array = [u8; 1]

type Index = SoundKind

impl BitmaskTrait for SwitchKind[src]

type Array = [u8; 3]

type Index = SwitchKind

impl BitmaskTrait for SynchronizeKind[src]

type Array = [u8; 2]

type Index = SynchronizeKind

impl BitmaskTrait for UInputKind[src]

type Array = [u8; 1]

type Index = UInputKind

Loading content...