pub struct U3vRegisterIo<T: UsbTransfer + 'static> { /* private fields */ }Expand description
Blocking RegisterIo adapter wrapping a U3vDevice.
Generic over T: UsbTransfer so that real hardware (NusbTransfer) and
test doubles (MockUsbTransfer, FakeU3vTransport) all work through the
same code path. USB operations are inherently synchronous, so this adapter
simply forwards calls through a Mutex for thread safety.
Implementations§
Source§impl<T: UsbTransfer + 'static> U3vRegisterIo<T>
impl<T: UsbTransfer + 'static> U3vRegisterIo<T>
Sourcepub fn is_lost(&self) -> bool
pub fn is_lost(&self) -> bool
Whether the camera is gone: a register access, a stream or an event
stream on it failed with
U3vError::Disconnected — unplugged,
or reset (backlog UV-03). It does not come back; open the camera
again once it is.
Sourcepub fn connection(&self) -> U3vConnection
pub fn connection(&self) -> U3vConnection
A handle that answers is_lost without the
transport: for a service watching a camera another task uses.
Sourcepub fn lock_device(&self) -> Result<MutexGuard<'_, U3vDevice<T>>, GenicamError>
pub fn lock_device(&self) -> Result<MutexGuard<'_, U3vDevice<T>>, GenicamError>
Lock the underlying device for direct access (e.g. stream configuration).
Trait Implementations§
Source§impl<T: UsbTransfer + 'static> RegisterIo for U3vRegisterIo<T>
Available on crate feature u3v only.
impl<T: UsbTransfer + 'static> RegisterIo for U3vRegisterIo<T>
Available on crate feature
u3v only.Auto Trait Implementations§
impl<T> Freeze for U3vRegisterIo<T>
impl<T> RefUnwindSafe for U3vRegisterIo<T>
impl<T> Send for U3vRegisterIo<T>
impl<T> Sync for U3vRegisterIo<T>
impl<T> Unpin for U3vRegisterIo<T>
impl<T> UnsafeUnpin for U3vRegisterIo<T>
impl<T> UnwindSafe for U3vRegisterIo<T>
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