pub struct Feature(/* private fields */);Expand description
Describes device input and output not intended for consumption by the end user.
For example, a software feature or Control Panel toggle.
§Data (Little-Endian)
- Bit 0: Data(0) | Constant(1)
- Bit 1: Array(0) | Variable(1)
- Bit 2: Absolute(0) | Relative(1)
- Bit 3: No Wrap(0) | Wrap(1)
- Bit 4: Linear(0) | Non Linear(1)
- Bit 5: Preferred State(0) | No Preferred(1)
- Bit 6: No Null Position(0) | Null State(1)
- Bit 7: Non Volatile(0) | Volatile(1)
- Bit 8: Bit Field(0) | Buffered Bytes(1)
- Bit 31-9: Reserved
Implementations§
Source§impl Feature
impl Feature
Sourcepub const PREFIX: u8 = 176u8
pub const PREFIX: u8 = 176u8
Prefix consists of tag(bit 7-4), type(bit 3-2) and size(bit 1-0).
The “size” part is set to 00 in this constant value.
Sourcepub unsafe fn new_unchecked(raw: &[u8]) -> Self
pub unsafe fn new_unchecked(raw: &[u8]) -> Self
Sourcepub fn new_with(data: &[u8]) -> Result<Self, HidError>
pub fn new_with(data: &[u8]) -> Result<Self, HidError>
Create an item with specific data.
NOTE: data size must be: 0, 1, 2 or 4.
Trait Implementations§
impl Eq for Feature
impl StructuralPartialEq for Feature
Auto Trait Implementations§
impl Freeze for Feature
impl RefUnwindSafe for Feature
impl Send for Feature
impl Sync for Feature
impl Unpin for Feature
impl UnwindSafe for Feature
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more