embassy-usb-host

Crates

git

Versions

default

Flavors

USBDescriptor

Trait USBDescriptor 

Source
pub trait USBDescriptor {
    type Error;

    const SIZE: usize;
    const DESC_TYPE: u8;

    // Required method
    fn try_from_bytes(bytes: &[u8]) -> Result<Self, Self::Error>
       where Self: Sized;
}
Expand description

Trait for fixed-size USB descriptors that can be parsed from a byte slice.

Required Associated Constants§

Required Associated Types§

Required Methods§

Source

fn try_from_bytes(bytes: &[u8]) -> Result<Self, Self::Error>
where Self: Sized,

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl USBDescriptor for UnitDescriptor

Source§

const SIZE: usize = 4usize

Source§

const DESC_TYPE: u8 = 36u8

Source§

type Error = ()

Source§

impl USBDescriptor for HIDDescriptor

Source§

const SIZE: usize = 9usize

Source§

const DESC_TYPE: u8 = 33u8

Source§

type Error = ()

Source§

impl USBDescriptor for AudioControlHeaderDescriptor

Source§

const SIZE: usize = 9usize

Source§

const DESC_TYPE: u8 = 36u8

Source§

type Error = ()

Source§

impl USBDescriptor for AudioEndpointDescriptor

Source§

const SIZE: usize = 6usize

Source§

const DESC_TYPE: u8 = 37u8

Source§

type Error = ()

Source§

impl USBDescriptor for AudioStreamingClassDescriptor

Source§

const SIZE: usize = 16usize

Source§

const DESC_TYPE: u8 = 36u8

Source§

type Error = ()

Source§

impl USBDescriptor for ClockMultiplierDescriptor

Source§

impl USBDescriptor for ClockSourceDescriptor

Source§

impl USBDescriptor for InputTerminalDescriptor

Source§

const SIZE: usize = 17usize

Source§

const DESC_TYPE: u8 = 36u8

Source§

type Error = ()

Source§

impl USBDescriptor for InterfaceAssociationDescriptor

Source§

const SIZE: usize = 8usize

Source§

const DESC_TYPE: u8 = 11u8

Source§

type Error = ()

Source§

impl USBDescriptor for OutputTerminalDescriptor

Source§

const SIZE: usize = 12usize

Source§

const DESC_TYPE: u8 = 36u8

Source§

type Error = ()

Source§

impl USBDescriptor for ConfigurationDescriptor<'_>

Source§

const SIZE: usize = 9usize

Source§

const DESC_TYPE: u8 = 2u8

Source§

type Error = ()

Source§

impl USBDescriptor for DeviceDescriptor

Source§

const SIZE: usize = 18usize

Source§

const DESC_TYPE: u8 = 1u8

Source§

type Error = ()

Source§

impl USBDescriptor for DeviceDescriptorPartial

Source§

const SIZE: usize = 8usize

Source§

const DESC_TYPE: u8 = 1u8

Source§

type Error = ()

Source§

impl USBDescriptor for EndpointDescriptor