BrailleDisplay

Enum BrailleDisplay 

Source
#[non_exhaustive]
pub enum BrailleDisplay {
Show 43 variants BrailleDisplay, BrailleRow, EightDotBrailleCell, SixDotBrailleCell, NumberofBrailleCells, ScreenReaderControl, ScreenReaderIdentifier, RouterSet1, RouterSet2, RouterSet3, RouterKey, RowRouterKey, BrailleButtons, BrailleKeyboardDot1, BrailleKeyboardDot2, BrailleKeyboardDot3, BrailleKeyboardDot4, BrailleKeyboardDot5, BrailleKeyboardDot6, BrailleKeyboardDot7, BrailleKeyboardDot8, BrailleKeyboardSpace, BrailleKeyboardLeftSpace, BrailleKeyboardRightSpace, BrailleFaceControls, BrailleLeftControls, BrailleRightControls, BrailleTopControls, BrailleJoystickCenter, BrailleJoystickUp, BrailleJoystickDown, BrailleJoystickLeft, BrailleJoystickRight, BrailleDPadCenter, BrailleDPadUp, BrailleDPadDown, BrailleDPadLeft, BrailleDPadRight, BraillePanLeft, BraillePanRight, BrailleRockerUp, BrailleRockerDown, BrailleRockerPress,
}
Expand description

Usage Page 0x41: “Braille Display”

This enum is autogenerated from the HID Usage Tables.

let u1 = Usage::BrailleDisplay(BrailleDisplay::BrailleRow);
let u2 = Usage::new_from_page_and_id(0x41, 0x2).unwrap();
let u3 = Usage::from(BrailleDisplay::BrailleRow);
let u4: Usage = BrailleDisplay::BrailleRow.into();
assert_eq!(u1, u2);
assert_eq!(u1, u3);
assert_eq!(u1, u4);

assert!(matches!(u1.usage_page(), UsagePage::BrailleDisplay));
assert_eq!(0x41, u1.usage_page_value());
assert_eq!(0x2, u1.usage_id_value());
assert_eq!((0x41 << 16) | 0x2, u1.usage_value());
assert_eq!("Braille Row", u1.name());

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

BrailleDisplay

Usage ID 0x1: “Braille Display”

§

BrailleRow

Usage ID 0x2: “Braille Row”

§

EightDotBrailleCell

Usage ID 0x3: “8 Dot Braille Cell”

§

SixDotBrailleCell

Usage ID 0x4: “6 Dot Braille Cell”

§

NumberofBrailleCells

Usage ID 0x5: “Number of Braille Cells”

§

ScreenReaderControl

Usage ID 0x6: “Screen Reader Control”

§

ScreenReaderIdentifier

Usage ID 0x7: “Screen Reader Identifier”

§

RouterSet1

Usage ID 0xFA: “Router Set 1”

§

RouterSet2

Usage ID 0xFB: “Router Set 2”

§

RouterSet3

Usage ID 0xFC: “Router Set 3”

§

RouterKey

Usage ID 0x100: “Router Key”

§

RowRouterKey

Usage ID 0x101: “Row Router Key”

§

BrailleButtons

Usage ID 0x200: “Braille Buttons”

§

BrailleKeyboardDot1

Usage ID 0x201: “Braille Keyboard Dot 1”

§

BrailleKeyboardDot2

Usage ID 0x202: “Braille Keyboard Dot 2”

§

BrailleKeyboardDot3

Usage ID 0x203: “Braille Keyboard Dot 3”

§

BrailleKeyboardDot4

Usage ID 0x204: “Braille Keyboard Dot 4”

§

BrailleKeyboardDot5

Usage ID 0x205: “Braille Keyboard Dot 5”

§

BrailleKeyboardDot6

Usage ID 0x206: “Braille Keyboard Dot 6”

§

BrailleKeyboardDot7

Usage ID 0x207: “Braille Keyboard Dot 7”

§

BrailleKeyboardDot8

Usage ID 0x208: “Braille Keyboard Dot 8”

§

BrailleKeyboardSpace

Usage ID 0x209: “Braille Keyboard Space”

§

BrailleKeyboardLeftSpace

Usage ID 0x20A: “Braille Keyboard Left Space”

§

BrailleKeyboardRightSpace

Usage ID 0x20B: “Braille Keyboard Right Space”

§

BrailleFaceControls

Usage ID 0x20C: “Braille Face Controls”

§

BrailleLeftControls

Usage ID 0x20D: “Braille Left Controls”

§

BrailleRightControls

Usage ID 0x20E: “Braille Right Controls”

§

BrailleTopControls

Usage ID 0x20F: “Braille Top Controls”

§

BrailleJoystickCenter

Usage ID 0x210: “Braille Joystick Center”

§

BrailleJoystickUp

Usage ID 0x211: “Braille Joystick Up”

§

BrailleJoystickDown

Usage ID 0x212: “Braille Joystick Down”

§

BrailleJoystickLeft

Usage ID 0x213: “Braille Joystick Left”

§

BrailleJoystickRight

Usage ID 0x214: “Braille Joystick Right”

§

BrailleDPadCenter

Usage ID 0x215: “Braille D-Pad Center”

§

BrailleDPadUp

Usage ID 0x216: “Braille D-Pad Up”

§

BrailleDPadDown

Usage ID 0x217: “Braille D-Pad Down”

§

BrailleDPadLeft

Usage ID 0x218: “Braille D-Pad Left”

§

BrailleDPadRight

Usage ID 0x219: “Braille D-Pad Right”

§

BraillePanLeft

Usage ID 0x21A: “Braille Pan Left”

§

BraillePanRight

Usage ID 0x21B: “Braille Pan Right”

§

BrailleRockerUp

Usage ID 0x21C: “Braille Rocker Up”

§

BrailleRockerDown

Usage ID 0x21D: “Braille Rocker Down”

§

BrailleRockerPress

Usage ID 0x21E: “Braille Rocker Press”

Implementations§

Trait Implementations§

Source§

impl AsUsage for BrailleDisplay

Source§

fn usage_value(&self) -> u32

Returns the 32 bit Usage value of this Usage

Source§

fn usage_id_value(&self) -> u16

Returns the 16 bit Usage ID value of this Usage

Source§

fn usage(&self) -> Usage

Returns this usage as Usage::BrailleDisplay(self) This is a convenience function to avoid having to implement From for every used type in the caller.

let gd_x = GenericDesktop::X;
let usage = Usage::from(GenericDesktop::X);
assert!(matches!(gd_x.usage(), usage));
Source§

impl AsUsagePage for BrailleDisplay

Source§

fn usage_page_value(&self) -> u16

Returns the 16 bit value of this UsagePage

This value is 0x41 for BrailleDisplay

Source§

fn usage_page(&self) -> UsagePage

Source§

impl BitOr<u16> for BrailleDisplay

Source§

fn bitor(self, usage: u16) -> Usage

A convenience function to combine a Usage Page with a value.

This function panics if the Usage ID value results in an unknown Usage. Where error checking is required, use UsagePage::to_usage_from_value.

Source§

type Output = Usage

The resulting type after applying the | operator.
Source§

impl Debug for BrailleDisplay

Source§

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

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

impl Display for BrailleDisplay

Available on crate feature std only.
Source§

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

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

impl From<&BrailleDisplay> for Usage

Source§

fn from(brailledisplay: &BrailleDisplay) -> Usage

Converts to this type from the input type.
Source§

impl From<&BrailleDisplay> for UsagePage

Source§

impl From<&BrailleDisplay> for u16

Source§

fn from(brailledisplay: &BrailleDisplay) -> u16

Converts to this type from the input type.
Source§

impl From<&BrailleDisplay> for u32

Source§

fn from(brailledisplay: &BrailleDisplay) -> u32

Returns the 32 bit value of this usage. This is identical to BrailleDisplay::usage_value().

Source§

impl From<BrailleDisplay> for Usage

Source§

fn from(brailledisplay: BrailleDisplay) -> Usage

Converts to this type from the input type.
Source§

impl From<BrailleDisplay> for UsagePage

Source§

impl From<BrailleDisplay> for u16

Source§

fn from(brailledisplay: BrailleDisplay) -> u16

Returns the 16bit value of this usage. This is identical to BrailleDisplay::usage_page_value().

Source§

impl TryFrom<u16> for BrailleDisplay

Source§

type Error = HutError

The type returned in the event of a conversion error.
Source§

fn try_from(usage_id: u16) -> Result<BrailleDisplay, HutError>

Performs the conversion.

Auto Trait Implementations§

Blanket Implementations§

§

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

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

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

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

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

§

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

Mutably borrows from an owned value. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T, U> Into<U> for T
where U: From<T>,

§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<T> ToString for T
where T: Display + ?Sized,

§

fn to_string(&self) -> String

Converts the given value to a String. Read more
§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

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

The type returned in the event of a conversion error.
§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.