pub struct HIDDescriptor {
pub bcd_hid: u16,
pub country_code: u8,
pub num_descriptors: u8,
pub descriptor_type0: u8,
pub descriptor_length0: u16,
}Expand description
USB HID class descriptor.
This descriptor identifies subordinate class descriptors. (USB HID 1.11 §6.2.1)
Fields§
§bcd_hid: u16USB HID specification version that the class descriptors comply to.
country_code: u8Country code.
For country code 0, the hardware is not localized.
Keyboards may use this field to identify the language of the key caps.
num_descriptors: u8Number of class descriptors.
descriptor_type0: u8Type of the class descriptor 0.
descriptor_length0: u16Length of the class descriptor 0.
Implementations§
Source§impl HIDDescriptor
impl HIDDescriptor
Sourcepub const SUPPORTED_DESCRIPTORS: u8 = 1u8
pub const SUPPORTED_DESCRIPTORS: u8 = 1u8
Maximum number of class descriptors that we support (at most 83).
Trait Implementations§
Source§impl Clone for HIDDescriptor
impl Clone for HIDDescriptor
Source§fn clone(&self) -> HIDDescriptor
fn clone(&self) -> HIDDescriptor
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for HIDDescriptor
impl Debug for HIDDescriptor
Source§impl Format for HIDDescriptor
impl Format for HIDDescriptor
Source§impl PartialEq for HIDDescriptor
impl PartialEq for HIDDescriptor
Source§impl USBDescriptor for HIDDescriptor
impl USBDescriptor for HIDDescriptor
type Error = DescriptorError
fn try_from_bytes(bytes: &[u8]) -> Result<Self, Self::Error>
Source§impl VariableSizeDescriptor for HIDDescriptor
impl VariableSizeDescriptor for HIDDescriptor
Source§fn match_bytes_len(bytes: &[u8]) -> bool
fn match_bytes_len(bytes: &[u8]) -> bool
Matches length with the number of class descriptors.
Source§fn match_bytes(bytes: &[u8]) -> Result<(), DescriptorError>
fn match_bytes(bytes: &[u8]) -> Result<(), DescriptorError>
Matches
bytes with this descriptor. Read moreSource§fn prepare_bytes(bytes: &mut [u8], len: u8) -> Result<(), DescriptorError>where
Self: WritableDescriptor,
fn prepare_bytes(bytes: &mut [u8], len: u8) -> Result<(), DescriptorError>where
Self: WritableDescriptor,
Prepares
bytes to receive descriptor data. Read moreSource§impl WritableDescriptor for HIDDescriptor
impl WritableDescriptor for HIDDescriptor
impl Copy for HIDDescriptor
impl Eq for HIDDescriptor
impl StructuralPartialEq for HIDDescriptor
Auto Trait Implementations§
impl Freeze for HIDDescriptor
impl RefUnwindSafe for HIDDescriptor
impl Send for HIDDescriptor
impl Sync for HIDDescriptor
impl Unpin for HIDDescriptor
impl UnwindSafe for HIDDescriptor
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