Skip to main content

U3vEventStream

Struct U3vEventStream 

Source
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

Source

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.

Source

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.

Source

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.
Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

fn pin_drop(self: Pin<&mut Self>)

🔬This is a nightly-only experimental API. (pin_ergonomics)
Execute the destructor for this type, but different to Drop::drop, it requires self to be pinned. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more