#[repr(C, packed(1))]pub struct CommandStatusWrapper {
pub signature: u32,
pub tag: u32,
pub data_residue: u32,
pub status: u8,
}Expand description
Command Status Wrapper (13 bytes)
Sent from device to host on the Bulk-In endpoint after command completion.
Fields§
§signature: u32Signature: must be CSW_SIGNATURE (0x53425355)
tag: u32Tag: must match the tag from the corresponding CBW
data_residue: u32Data residue: difference between expected and actual data transferred
status: u8Status byte
Implementations§
Source§impl CommandStatusWrapper
impl CommandStatusWrapper
Sourcepub fn from_bytes(data: &[u8]) -> Result<Self, KernelError>
pub fn from_bytes(data: &[u8]) -> Result<Self, KernelError>
Deserialize a CSW from a 13-byte slice
Sourcepub fn get_status(&self) -> CswStatus
pub fn get_status(&self) -> CswStatus
Get the status as a typed enum
Trait Implementations§
Source§impl Clone for CommandStatusWrapper
impl Clone for CommandStatusWrapper
Source§fn clone(&self) -> CommandStatusWrapper
fn clone(&self) -> CommandStatusWrapper
Returns a duplicate of the value. Read more
1.0.0§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for CommandStatusWrapper
impl Debug for CommandStatusWrapper
impl Copy for CommandStatusWrapper
Auto Trait Implementations§
impl Freeze for CommandStatusWrapper
impl RefUnwindSafe for CommandStatusWrapper
impl Send for CommandStatusWrapper
impl Sync for CommandStatusWrapper
impl Unpin for CommandStatusWrapper
impl UnwindSafe for CommandStatusWrapper
Blanket Implementations§
§impl<T> Any for Twhere
T: 'static + ?Sized,
impl<T> Any for Twhere
T: 'static + ?Sized,
§impl<T> Borrow<T> for Twhere
T: ?Sized,
impl<T> Borrow<T> for Twhere
T: ?Sized,
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
🔬This is a nightly-only experimental API. (
clone_to_uninit)