pub trait USBDescriptor {
type Error;
const BUF_SIZE: usize;
const DESC_TYPE: u8;
const DESC_SUBTYPE: Option<u8> = None;
// Required method
fn try_from_bytes(bytes: &[u8]) -> Result<Self, Self::Error>
where Self: Sized;
}Expand description
Trait for a USB descriptor that can be parsed from a byte slice.
Required Associated Constants§
Provided Associated Constants§
Sourceconst DESC_SUBTYPE: Option<u8> = None
const DESC_SUBTYPE: Option<u8> = None
Descriptor subtype.
If this constant is None, then it is ignored.
If this constant is Some(subtype), then subtype is compared against byte 2 of the buffer while reading.
This constant is None by default.
Required Associated Types§
Required Methods§
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.