pub struct U3vEventStream { /* private fields */ }Expand description
Events from a USB3 Vision camera’s event interface, read on a thread of its own (backlog TC-27 (4)).
Each is an Event whose raw is the event as GenCP lays it out — its
ID at 0x2, its timestamp at 0x4, its data at 0xC — which is what the
camera’s event ports address (Camera::with_event).
USB3 Vision events have no stream channel or block id of their own: both
are 0. Dropping the stream stops the reader and restores the device’s
previous EventEnable control word. Use U3vEventStream::shutdown for
awaited cleanup with restoration errors.
Implementations§
Source§impl U3vEventStream
impl U3vEventStream
Sourcepub async fn shutdown(self) -> Result<(), GenicamError>
pub async fn shutdown(self) -> Result<(), GenicamError>
Stop and join the event reader on the blocking pool, then restore the exact EventEnable control word saved before the reader was opened.
Do not hold the camera or device mutex while awaiting this method. A disconnected device is not written; the returned error records that its previous EventEnable state could not be restored.
Sourcepub async fn next(&self) -> Result<Event, GenicamError>
pub async fn next(&self) -> Result<Event, GenicamError>
The next event; an error once the stream has ended, by failing —
with U3vError::Disconnected as
the source when the camera is gone — or by being closed.
Sourcepub fn next_blocking(
&self,
timeout: Duration,
) -> Result<Option<Event>, GenicamError>
pub fn next_blocking( &self, timeout: Duration, ) -> Result<Option<Event>, GenicamError>
Wait up to timeout for the next event on the calling thread:
Ok(None) when the stream has ended, GenicamError::Timeout when
nothing arrived.
Trait Implementations§
Source§impl Drop for U3vEventStream
Available on crate feature u3v only.
impl Drop for U3vEventStream
u3v only.