pub struct Command<'a, Kind, Class> {
pub kind: Kind,
pub lun: u8,
/* private fields */
}Expand description
The subclass’ command and a LUN it is addressed to
Fields§
§kind: Kind§lun: u8Implementations§
Source§impl<'a, 'alloc, Bus: UsbBus + 'alloc, Buf: BorrowMut<[u8]>> Command<'a, UfiCommand, Ufi<BulkOnly<'alloc, Bus, Buf>>>
UFI over Bulk Only Transport command
impl<'a, 'alloc, Bus: UsbBus + 'alloc, Buf: BorrowMut<[u8]>> Command<'a, UfiCommand, Ufi<BulkOnly<'alloc, Bus, Buf>>>
UFI over Bulk Only Transport command
Sourcepub fn read_data(
&mut self,
dst: &mut [u8],
) -> Result<usize, TransportError<BulkOnlyError>>
pub fn read_data( &mut self, dst: &mut [u8], ) -> Result<usize, TransportError<BulkOnlyError>>
Sourcepub fn write_data(
&mut self,
src: &[u8],
) -> Result<usize, TransportError<BulkOnlyError>>
pub fn write_data( &mut self, src: &[u8], ) -> Result<usize, TransportError<BulkOnlyError>>
Sourcepub fn try_write_data_all(
&mut self,
src: &[u8],
) -> Result<(), TransportError<BulkOnlyError>>
pub fn try_write_data_all( &mut self, src: &[u8], ) -> Result<(), TransportError<BulkOnlyError>>
Sourcepub fn pass(self, num_bytes_processed: u32)
pub fn pass(self, num_bytes_processed: u32)
Mark command as successful (0x00)
§Arguments
- num_bytes_processed - the actual number of bytes the device has actually processed.
The
dCBWDataTransferLength - num_bytes_processedis what is going to be sent in the CSW
Sourcepub fn fail(self, num_bytes_processed: u32)
pub fn fail(self, num_bytes_processed: u32)
Mark command as failed (0x01)
§Arguments
- num_bytes_processed - the actual number of bytes the device has actually processed.
The
dCBWDataTransferLength - num_bytes_processedis what is going to be sent in the CSW
Sourcepub fn fail_phase(self)
pub fn fail_phase(self)
Mark command as phase-failed (0x02)
Source§impl<'a, 'alloc, Bus: UsbBus + 'alloc, Buf: BorrowMut<[u8]>> Command<'a, ScsiCommand, Scsi<BulkOnly<'alloc, Bus, Buf>>>
SCSI over Bulk Only Transport command
impl<'a, 'alloc, Bus: UsbBus + 'alloc, Buf: BorrowMut<[u8]>> Command<'a, ScsiCommand, Scsi<BulkOnly<'alloc, Bus, Buf>>>
SCSI over Bulk Only Transport command
Sourcepub fn read_data(
&mut self,
dst: &mut [u8],
) -> Result<usize, TransportError<BulkOnlyError>>
pub fn read_data( &mut self, dst: &mut [u8], ) -> Result<usize, TransportError<BulkOnlyError>>
Sourcepub fn write_data(
&mut self,
src: &[u8],
) -> Result<usize, TransportError<BulkOnlyError>>
pub fn write_data( &mut self, src: &[u8], ) -> Result<usize, TransportError<BulkOnlyError>>
Sourcepub fn try_write_data_all(
&mut self,
src: &[u8],
) -> Result<(), TransportError<BulkOnlyError>>
pub fn try_write_data_all( &mut self, src: &[u8], ) -> Result<(), TransportError<BulkOnlyError>>
Sourcepub fn pass(self, num_bytes_processed: u32)
pub fn pass(self, num_bytes_processed: u32)
Mark command as successful (0x00)
§Arguments
- num_bytes_processed - the actual number of bytes the device has actually processed.
The
dCBWDataTransferLength - num_bytes_processedis what is going to be sent in the CSW
Sourcepub fn fail(self, num_bytes_processed: u32)
pub fn fail(self, num_bytes_processed: u32)
Mark command as failed (0x01)
§Arguments
- num_bytes_processed - the actual number of bytes the device has actually processed.
The
dCBWDataTransferLength - num_bytes_processedis what is going to be sent in the CSW
Sourcepub fn fail_phase(self)
pub fn fail_phase(self)
Mark command as phase-failed (0x02)
Auto Trait Implementations§
impl<'a, Kind, Class> !UnwindSafe for Command<'a, Kind, Class>
impl<'a, Kind, Class> Freeze for Command<'a, Kind, Class>
impl<'a, Kind, Class> RefUnwindSafe for Command<'a, Kind, Class>
impl<'a, Kind, Class> Send for Command<'a, Kind, Class>
impl<'a, Kind, Class> Sync for Command<'a, Kind, Class>
impl<'a, Kind, Class> Unpin for Command<'a, Kind, Class>
impl<'a, Kind, Class> UnsafeUnpin for Command<'a, Kind, Class>
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