[][src]Struct input_linux::bitmask::Bitmask

pub struct Bitmask<T: BitmaskTrait> { /* fields omitted */ }

A set of bits that can be indexed by specific enum values.

Implementations

impl Bitmask<Vec<u8>>[src]

pub fn resize(&mut self, kind: EventKind)[src]

Reallocate the bitmask to fit all valid code values for the given event type.

impl<T: BitmaskTrait> Bitmask<T>[src]

pub const EMPTY: Self[src]

A new empty bitmask.

pub fn into_inner(self) -> T::Array[src]

Extracts the underlying bitmask data.

pub fn iter(&self) -> BitmaskIterator<T>

Important traits for BitmaskIterator<'a, T>

impl<'a, T: BitmaskTrait> Iterator for BitmaskIterator<'a, T> type Item = T::Index;
[src]

Iterates over all set bits.

pub fn data(&self) -> &T::Array[src]

Borrows the underlying bitmask data.

pub fn data_mut(&mut self) -> &mut T::Array[src]

Mutably borrows the underlying bitmask data.

pub fn clear(&mut self)[src]

Unset all bits in the bitmask.

pub fn get(&self, index: T::Index) -> bool[src]

Gets the status of an index in the bitmask.

pub fn insert(&mut self, index: T::Index)[src]

Sets the status of an index in the bitmask.

pub fn remove(&mut self, index: T::Index)[src]

Clears the status of an index in the bitmask.

pub fn toggle(&mut self, index: T::Index)[src]

Inverts the status of an index in the bitmask.

pub fn or<I: IntoIterator<Item = T::Index>>(&mut self, indices: I)[src]

Merges the provided indices into the bitmask.

Trait Implementations

impl<T: BitmaskTrait> AsMut<[u8]> for Bitmask<T>[src]

impl<T: BitmaskTrait> AsRef<[u8]> for Bitmask<T>[src]

impl<T: Clone + BitmaskTrait> Clone for Bitmask<T> where
    T::Array: Clone
[src]

impl<T: Copy + BitmaskTrait> Copy for Bitmask<T> where
    T::Array: Copy
[src]

impl<T: BitmaskTrait> Debug for Bitmask<T> where
    T::Index: Debug
[src]

impl<T: BitmaskTrait> Default for Bitmask<T>[src]

impl<T: BitmaskTrait> Deref for Bitmask<T>[src]

type Target = [u8]

The resulting type after dereferencing.

impl<T: BitmaskTrait> DerefMut for Bitmask<T>[src]

impl<'a, T: BitmaskTrait> IntoIterator for &'a Bitmask<T>[src]

type Item = T::Index

The type of the elements being iterated over.

type IntoIter = BitmaskIterator<'a, T>

Which kind of iterator are we turning this into?

Auto Trait Implementations

impl<T> RefUnwindSafe for Bitmask<T> where
    <T as BitmaskTrait>::Array: RefUnwindSafe

impl<T> Send for Bitmask<T> where
    <T as BitmaskTrait>::Array: Send

impl<T> Sync for Bitmask<T> where
    <T as BitmaskTrait>::Array: Sync

impl<T> Unpin for Bitmask<T> where
    <T as BitmaskTrait>::Array: Unpin

impl<T> UnwindSafe for Bitmask<T> where
    <T as BitmaskTrait>::Array: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.