pub trait UsbTransfer: Send + Sync {
// Required methods
fn bulk_write(
&self,
endpoint: u8,
data: &[u8],
timeout: Duration,
) -> Result<usize, U3vError>;
fn bulk_read(
&self,
endpoint: u8,
buf: &mut [u8],
timeout: Duration,
) -> Result<usize, U3vError>;
}Expand description
Abstraction over a claimed USB device for bulk endpoint I/O.
Implementations must be safe to share across threads. The control and
stream channels use different endpoints, so a single UsbTransfer can
serve both concurrently (with internal synchronization if needed).