#[non_exhaustive]pub struct UsbControlRequest {
pub request_type: UsbRequestType,
pub recipient: UsbRecipient,
pub request: u8,
pub value: u16,
pub index: u16,
}
Expand description
USB control request.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. }
syntax; cannot be matched against without a wildcard ..
; and struct update syntax will not work.request_type: UsbRequestType
Whether the request is standard, class-specific or vendor-specific.
recipient: UsbRecipient
The target of the transfer on the device.
request: u8
Vendor-specific command.
value: u16
Vendor-specific request parameters.
index: u16
The interface number of the recipient.
Implementations§
Source§impl UsbControlRequest
impl UsbControlRequest
Sourcepub const fn new(
request_type: UsbRequestType,
recipient: UsbRecipient,
request: u8,
value: u16,
index: u16,
) -> Self
pub const fn new( request_type: UsbRequestType, recipient: UsbRecipient, request: u8, value: u16, index: u16, ) -> Self
Creates a new USB control request with the specified parameters.
Trait Implementations§
Source§impl Clone for UsbControlRequest
impl Clone for UsbControlRequest
Source§fn clone(&self) -> UsbControlRequest
fn clone(&self) -> UsbControlRequest
Returns a duplicate of the value. Read more
1.0.0 · Source§const fn clone_from(&mut self, source: &Self)
const fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for UsbControlRequest
impl Debug for UsbControlRequest
Source§impl From<&UsbControlRequest> for UsbControlTransferParameters
impl From<&UsbControlRequest> for UsbControlTransferParameters
Source§fn from(req: &UsbControlRequest) -> Self
fn from(req: &UsbControlRequest) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for UsbControlRequest
impl RefUnwindSafe for UsbControlRequest
impl Send for UsbControlRequest
impl Sync for UsbControlRequest
impl Unpin for UsbControlRequest
impl UnwindSafe for UsbControlRequest
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