pub enum UsbClass {
Show 23 variants
PerInterface,
Audio,
Comm,
Hid,
Physical,
Imaging,
Printer,
Msc,
Hub,
Cdc,
Ccid,
Security,
Video,
Healthcare,
AudioVideo,
Billboard,
TypeCBridge,
Diagnostic,
Wireless,
Misc,
ApplicationSpecific,
Vendor,
Undefined,
// some variants omitted
}Expand description
Standard USB class codes as defined in USB 2.0 specification Table 9-8 and Table 9-12 (and the USB-IF Defined Class Codes registry).
Architectural Note: Driver maintainers should explicitly handle .is_unknown() fallback
paths in match/switch statements for extensible class codes and vendor protocols, preserving
wire compatibility with novel USB hardware and future specification additions.
Variants§
PerInterface
Audio
Comm
Hid
Physical
Imaging
Printer
Msc
Hub
Cdc
Ccid
Security
Video
Healthcare
AudioVideo
Billboard
TypeCBridge
Diagnostic
Wireless
Misc
ApplicationSpecific
Vendor
Undefined
By designating 0xee as @unknown UNDEFINED, it is impossible for a legitimate physical USB device class descriptor to collide with our sentinel. This allows FIDL to safely parse valid vendor-specific devices (0xff) while gracefully handling any unexpected or newly invented class codes as is_unknown() == true.
Implementations§
Trait Implementations§
impl Copy for UsbClass
Source§impl<D> Decode<UsbClass, D> for UsbClasswhere
D: ResourceDialect,
impl<D> Decode<UsbClass, D> for UsbClasswhere
D: ResourceDialect,
impl Eq for UsbClass
Source§impl Ord for UsbClass
impl Ord for UsbClass
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the minimum of two values. Read more
Source§impl PartialOrd for UsbClass
impl PartialOrd for UsbClass
impl StructuralPartialEq for UsbClass
Source§impl TypeMarker for UsbClass
impl TypeMarker for UsbClass
Source§fn inline_align(_context: Context) -> usize
fn inline_align(_context: Context) -> usize
Returns the minimum required alignment of the inline portion of the
encoded object. It must be a (nonzero) power of two.
Source§fn inline_size(_context: Context) -> usize
fn inline_size(_context: Context) -> usize
Returns the size of the inline portion of the encoded object, including
padding for alignment. Must be a multiple of
inline_align.Source§fn encode_is_copy() -> bool
fn encode_is_copy() -> bool
Returns true if the memory layout of
Self::Owned matches the FIDL wire
format and encoding requires no validation. When true, we can optimize
encoding arrays and vectors of Self::Owned to a single memcpy. Read moreSource§fn decode_is_copy() -> bool
fn decode_is_copy() -> bool
Returns true if the memory layout of
Self::Owned matches the FIDL wire
format and decoding requires no validation. When true, we can optimize
decoding arrays and vectors of Self::Owned to a single memcpy.Source§impl ValueTypeMarker for UsbClass
impl ValueTypeMarker for UsbClass
Source§type Borrowed<'a> = UsbClass
type Borrowed<'a> = UsbClass
The Rust type to use for encoding. This is a particular
Encode<Self>
type cheaply obtainable from &Self::Owned. There are three cases: Read moreSource§fn borrow(
value: &<UsbClass as TypeMarker>::Owned,
) -> <UsbClass as ValueTypeMarker>::Borrowed<'_>
fn borrow( value: &<UsbClass as TypeMarker>::Owned, ) -> <UsbClass as ValueTypeMarker>::Borrowed<'_>
Cheaply converts from
&Self::Owned to Self::Borrowed.Auto Trait Implementations§
impl Freeze for UsbClass
impl RefUnwindSafe for UsbClass
impl Send for UsbClass
impl Sync for UsbClass
impl Unpin for UsbClass
impl UnsafeUnpin for UsbClass
impl UnwindSafe for UsbClass
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