pub struct Transfer {
urb: Vec<usbdevfs_urb>,
pub buffer: TransferBuffer,
callback: Option<Box<dyn Fn(Transfer) + Send + Sync>>,
}
Expand description
Transfer contains the information necessary to submit a USB request and, once it has been submitted and completed, contains the response.
Fields§
§urb: Vec<usbdevfs_urb>
§buffer: TransferBuffer
§callback: Option<Box<dyn Fn(Transfer) + Send + Sync>>
Implementations§
source§impl Transfer
impl Transfer
fn urb(&self) -> &usbdevfs_urb
fn urb_mut(&mut self) -> &mut usbdevfs_urb
fn new( transfer_type: u8, endpoint: u8, buffer: TransferBuffer, iso_packets: &[usbdevfs_iso_packet_desc] ) -> Result<Transfer>
sourcepub fn new_control(buffer: TransferBuffer) -> Result<Transfer>
pub fn new_control(buffer: TransferBuffer) -> Result<Transfer>
Create a control transfer.
sourcepub fn new_interrupt(endpoint: u8, buffer: TransferBuffer) -> Result<Transfer>
pub fn new_interrupt(endpoint: u8, buffer: TransferBuffer) -> Result<Transfer>
Create an interrupt transfer.
sourcepub fn new_bulk(
endpoint: u8,
buffer: TransferBuffer,
stream_id: Option<u16>
) -> Result<Transfer>
pub fn new_bulk( endpoint: u8, buffer: TransferBuffer, stream_id: Option<u16> ) -> Result<Transfer>
Create a bulk transfer.
sourcepub fn new_isochronous(endpoint: u8, buffer: TransferBuffer) -> Result<Transfer>
pub fn new_isochronous(endpoint: u8, buffer: TransferBuffer) -> Result<Transfer>
Create an isochronous transfer.
sourcepub fn status(&self) -> TransferStatus
pub fn status(&self) -> TransferStatus
Get the status of a completed transfer.
sourcepub fn actual_length(&self) -> usize
pub fn actual_length(&self) -> usize
Get the actual amount of data transferred, which may be less than the original length.
Auto Trait Implementations§
impl !RefUnwindSafe for Transfer
impl Send for Transfer
impl Sync for Transfer
impl Unpin for Transfer
impl !UnwindSafe for Transfer
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