Struct evdev::AttributeSetRef

source ·
pub struct AttributeSetRef<T> { /* private fields */ }
Available on Unix only.
Expand description

A collection of bits representing either device capability or state.

This can be used to iterate across all keys supported by a keyboard, or all buttons supported by a joystick. You can also query directly whether a specific bit is set (corresponding to whether a key or button is depressed).

Implementations§

source§

impl<T: EvdevEnum> AttributeSetRef<T>

source

pub fn contains(&self, attr: T) -> bool

Returns true if this AttributeSet contains the passed T.

source

pub fn iter(&self) -> AttributeSetRefIter<'_, T>

Provides an iterator over all “set” bits in the collection.

source

pub fn insert(&mut self, attr: T)

source

pub fn remove(&mut self, attr: T)

Trait Implementations§

source§

impl<T: EvdevEnum + Debug> Debug for AttributeSetRef<T>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<T: EvdevEnum> Default for &AttributeSetRef<T>

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl<T: EvdevEnum> Default for &mut AttributeSetRef<T>

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl<'a, T: EvdevEnum> IntoIterator for &'a AttributeSetRef<T>

§

type Item = T

The type of the elements being iterated over.
§

type IntoIter = AttributeSetRefIter<'a, T>

Which kind of iterator are we turning this into?
source§

fn into_iter(self) -> Self::IntoIter

Creates an iterator from a value. Read more

Auto Trait Implementations§

§

impl<T> Freeze for AttributeSetRef<T>

§

impl<T> RefUnwindSafe for AttributeSetRef<T>
where T: RefUnwindSafe,

§

impl<T> Send for AttributeSetRef<T>
where T: Send,

§

impl<T> !Sized for AttributeSetRef<T>

§

impl<T> Sync for AttributeSetRef<T>
where T: Sync,

§

impl<T> Unpin for AttributeSetRef<T>
where T: Unpin,

§

impl<T> UnwindSafe for AttributeSetRef<T>
where T: UnwindSafe,

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> Pipe for T
where T: ?Sized,

source§

fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> R
where Self: Sized,

Pipes by value. This is generally the method you want to use. Read more
source§

fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> R
where R: 'a,

Borrows self and passes that borrow into the pipe function. Read more
source§

fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> R
where R: 'a,

Mutably borrows self and passes that borrow into the pipe function. Read more
source§

fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
where Self: Borrow<B>, B: 'a + ?Sized, R: 'a,

Borrows self, then passes self.borrow() into the pipe function. Read more
source§

fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R ) -> R
where Self: BorrowMut<B>, B: 'a + ?Sized, R: 'a,

Mutably borrows self, then passes self.borrow_mut() into the pipe function. Read more
source§

fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
where Self: AsRef<U>, U: 'a + ?Sized, R: 'a,

Borrows self, then passes self.as_ref() into the pipe function.
source§

fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
where Self: AsMut<U>, U: 'a + ?Sized, R: 'a,

Mutably borrows self, then passes self.as_mut() into the pipe function.
source§

fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
where Self: Deref<Target = T>, T: 'a + ?Sized, R: 'a,

Borrows self, then passes self.deref() into the pipe function.
source§

fn pipe_deref_mut<'a, T, R>( &'a mut self, func: impl FnOnce(&'a mut T) -> R ) -> R
where Self: DerefMut<Target = T> + Deref, T: 'a + ?Sized, R: 'a,

Mutably borrows self, then passes self.deref_mut() into the pipe function.