pub struct RequestType {
pub direction: Direction,
pub control_type: ControlType,
pub recipient: Recipient,
}Expand description
USB control request type (bmRequestType).
Encodes the three sub-fields of bmRequestType (USB 2.0 spec Table 9-2):
direction (bit 7), type (bits 6..5) and recipient (bits 4..0).
Fields§
§direction: DirectionTransfer direction (IN = device→host, OUT = host→device).
control_type: ControlTypeWhether this is a standard, class, vendor, or reserved request.
recipient: RecipientRecipient of the request.
Implementations§
Source§impl RequestType
impl RequestType
Sourcepub const fn to_bits(self) -> u8
pub const fn to_bits(self) -> u8
Encode this request type to its wire-format bmRequestType byte.
Sourcepub const fn from_bits(b: u8) -> Self
pub const fn from_bits(b: u8) -> Self
Decode a wire-format bmRequestType byte.
Reserved type values decode to ControlType::Reserved; reserved
recipient values (4..=31) decode to Recipient::Reserved.
Trait Implementations§
Source§impl Clone for RequestType
impl Clone for RequestType
Source§fn clone(&self) -> RequestType
fn clone(&self) -> RequestType
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 RequestType
impl Debug for RequestType
Source§impl Format for RequestType
impl Format for RequestType
Source§impl PartialEq for RequestType
impl PartialEq for RequestType
impl Copy for RequestType
impl Eq for RequestType
impl StructuralPartialEq for RequestType
Auto Trait Implementations§
impl Freeze for RequestType
impl RefUnwindSafe for RequestType
impl Send for RequestType
impl Sync for RequestType
impl Unpin for RequestType
impl UnwindSafe for RequestType
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