Struct usb_util::types::UsbRequestSetup
source · #[repr(C, packed(1))]pub struct UsbRequestSetup {
pub request_type: u8,
pub request: u8,
pub value: u16,
pub index: u16,
pub length: u16,
}
Expand description
RequestSetup is first part of control transfer buffer.
Fields§
§request_type: u8
§request: u8
§value: u16
§index: u16
§length: u16
Implementations§
source§impl UsbRequestSetup
impl UsbRequestSetup
pub fn new( request_type: u8, request: u8, value: u16, index: u16, length: u16 ) -> UsbRequestSetup
sourcepub fn get_type(&self) -> ControlRequestType
pub fn get_type(&self) -> ControlRequestType
Get type of request.
sourcepub fn get_direction(&self) -> ControlRequestDataPhaseTransferDirection
pub fn get_direction(&self) -> ControlRequestDataPhaseTransferDirection
Get request direction.
sourcepub fn get_recipient(&self) -> ControlRequestRecipient
pub fn get_recipient(&self) -> ControlRequestRecipient
Get recipient of this control transfer.
sourcepub fn get_standard_request(&self) -> Option<StandardControlRequest>
pub fn get_standard_request(&self) -> Option<StandardControlRequest>
Return the type of standard control request.
Trait Implementations§
source§impl AsBytes for UsbRequestSetup
impl AsBytes for UsbRequestSetup
§fn as_bytes_mut(&mut self) -> &mut [u8] ⓘwhere
Self: FromBytes,
fn as_bytes_mut(&mut self) -> &mut [u8] ⓘwhere
Self: FromBytes,
Gets the bytes of this value mutably. Read more
§fn write_to_prefix(&self, bytes: &mut [u8]) -> Option<()>
fn write_to_prefix(&self, bytes: &mut [u8]) -> Option<()>
source§impl Clone for UsbRequestSetup
impl Clone for UsbRequestSetup
source§fn clone(&self) -> UsbRequestSetup
fn clone(&self) -> UsbRequestSetup
Returns a copy 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 UsbRequestSetup
impl Debug for UsbRequestSetup
source§impl FromBytes for UsbRequestSetup
impl FromBytes for UsbRequestSetup
§fn slice_from_prefix(bytes: &[u8], count: usize) -> Option<(&[Self], &[u8])>where
Self: Sized,
fn slice_from_prefix(bytes: &[u8], count: usize) -> Option<(&[Self], &[u8])>where
Self: Sized,
Interprets the prefix of the given
bytes
as a &[Self]
with length
equal to count
without copying. Read more§fn slice_from_suffix(bytes: &[u8], count: usize) -> Option<(&[u8], &[Self])>where
Self: Sized,
fn slice_from_suffix(bytes: &[u8], count: usize) -> Option<(&[u8], &[Self])>where
Self: Sized,
Interprets the suffix of the given
bytes
as a &[Self]
with length
equal to count
without copying. Read more§fn mut_slice_from_prefix(
bytes: &mut [u8],
count: usize
) -> Option<(&mut [Self], &mut [u8])>where
Self: Sized + AsBytes,
fn mut_slice_from_prefix(
bytes: &mut [u8],
count: usize
) -> Option<(&mut [Self], &mut [u8])>where
Self: Sized + AsBytes,
Interprets the prefix of the given
bytes
as a &mut [Self]
with length
equal to count
without copying. Read more§fn mut_slice_from_suffix(
bytes: &mut [u8],
count: usize
) -> Option<(&mut [u8], &mut [Self])>where
Self: Sized + AsBytes,
fn mut_slice_from_suffix(
bytes: &mut [u8],
count: usize
) -> Option<(&mut [u8], &mut [Self])>where
Self: Sized + AsBytes,
Interprets the suffix of the given
bytes
as a &mut [Self]
with length
equal to count
without copying. Read more§fn read_from_prefix(bytes: &[u8]) -> Option<Self>where
Self: Sized,
fn read_from_prefix(bytes: &[u8]) -> Option<Self>where
Self: Sized,
source§impl FromZeroes for UsbRequestSetup
impl FromZeroes for UsbRequestSetup
impl Copy for UsbRequestSetup
Auto Trait Implementations§
impl RefUnwindSafe for UsbRequestSetup
impl Send for UsbRequestSetup
impl Sync for UsbRequestSetup
impl Unpin for UsbRequestSetup
impl UnwindSafe for UsbRequestSetup
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