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

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

    const ZERO: Self::Array;

    fn array_default() -> Self::Array;
fn array_slice(array: &Self::Array) -> &[u8];
fn array_slice_mut(array: &mut Self::Array) -> &mut [u8];
fn index(index: Self::Index) -> usize; 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

The underlying array storage data type.

type Index: Copy + IterableEnum

The type that the bitmask can be indexed by.

Loading content...

Associated Constants

const ZERO: Self::Array

Empty default data.

Loading content...

Required methods

fn array_default() -> Self::Array

The default empty state of the bitmask.

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

A representation of the bitmask as a slice of bytes.

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

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

fn index(index: Self::Index) -> usize

Computes a normalized index value.

Loading content...

Provided methods

fn index_valid(_array: &Self::Array, _index: Self::Index) -> bool

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; 2]

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...