pub struct NusbTransfer { /* private fields */ }Expand description
UsbTransfer over a USB3 Vision device opened with nusb: its
control interface claimed, and its streaming and event interfaces when
it has them.
A streaming or event interface that cannot be claimed does not stop the camera from opening — its features still work — but opening a stream or events on it returns the claim’s error (backlog UV-03: it used to be discarded).
Implementations§
Source§impl NusbTransfer
impl NusbTransfer
Sourcepub fn open(info: &U3vDeviceInfo) -> Result<Self, U3vError>
pub fn open(info: &U3vDeviceInfo) -> Result<Self, U3vError>
Open the device enumeration reported as info and claim its
USB3 Vision interfaces: control, and streaming and events where it
has them. U3vDevice::open_device
opens one this way.
Sourcepub fn interfaces(&self) -> &U3vInterfaceInfo
pub fn interfaces(&self) -> &U3vInterfaceInfo
The device’s USB3 Vision interfaces and endpoints.
Trait Implementations§
Source§impl UsbTransfer for NusbTransfer
impl UsbTransfer for NusbTransfer
Source§fn bulk_write(
&self,
endpoint: u8,
data: &[u8],
timeout: Duration,
) -> Result<usize, U3vError>
fn bulk_write( &self, endpoint: u8, data: &[u8], timeout: Duration, ) -> Result<usize, U3vError>
Write
data to the bulk OUT endpoint. Returns bytes written.Source§fn bulk_read(
&self,
endpoint: u8,
buf: &mut [u8],
timeout: Duration,
) -> Result<usize, U3vError>
fn bulk_read( &self, endpoint: u8, buf: &mut [u8], timeout: Duration, ) -> Result<usize, U3vError>
Read up to
buf.len() bytes from the bulk IN endpoint.
Returns the number of bytes actually read.Source§fn bulk_in(self: &Arc<Self>, endpoint: u8) -> Result<Box<dyn BulkIn>, U3vError>
fn bulk_in(self: &Arc<Self>, endpoint: u8) -> Result<Box<dyn BulkIn>, U3vError>
Reads on the bulk IN
endpoint that can be queued ahead of the
device, as a stream needs them. Read moreSource§fn max_packet_size(&self, endpoint: u8) -> Option<usize>
fn max_packet_size(&self, endpoint: u8) -> Option<usize>
The largest packet the endpoint carries, from its descriptor;
None
when unknown. Every IN transfer a stream asks for is a multiple of
it, so that a packet never straddles two transfers.Source§fn link_speed(&self) -> Option<UsbSpeed>
fn link_speed(&self) -> Option<UsbSpeed>
The speed the host’s USB stack reports the device runs at;
None
when this transport cannot tell.Source§fn is_present(&self) -> Option<bool>
fn is_present(&self) -> Option<bool>
Whether the operating system still lists the device, asked after a
transfer failed in a way that does not say whether it is gone;
None when this transport cannot tell. One look, no waiting.Auto Trait Implementations§
impl !Freeze for NusbTransfer
impl RefUnwindSafe for NusbTransfer
impl Send for NusbTransfer
impl Sync for NusbTransfer
impl Unpin for NusbTransfer
impl UnsafeUnpin for NusbTransfer
impl UnwindSafe for NusbTransfer
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