Skip to main content

StreamCounters

Struct StreamCounters 

Source
#[non_exhaustive]
pub struct StreamCounters {
Show 17 fields pub frames_complete: u64, pub frames_incomplete: u64, pub frames_missed: u64, pub frames_backpressure: u64, pub frames_unsupported: u64, pub packets_received: u64, pub packets_missing: u64, pub packets_duplicate: u64, pub packets_ignored: u64, pub resend_requested: u64, pub resend_recovered: u64, pub resend_unavailable: u64, pub transfer_errors: u64, pub bytes: u64, pub avg_mbps: f64, pub avg_latency_ms: Option<f64>, pub elapsed_ms: u64,
}
Expand description

One stream’s counters on the wire: viva_genicam::StreamStats, with the six reasons a packet was ignored summed into one.

USB3 Vision streams fill the frame counters the same way. Of the packet counters, packets_received counts bulk transfers and packets_ignored the transfers that were not the leader, payload or trailer due; transfer_errors counts failed transfers the stream recovered from. The other packet and resend counters stay 0.

Every block the camera sends is counted once, when its fate is decided: complete, incomplete, missed, dropped to backpressure or unsupported. A frame still waiting in the delivery queue is in none of them yet.

Fields (Non-exhaustive)§

This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.
§frames_complete: u64

Frames handed to the application with every packet present.

§frames_incomplete: u64

Frames closed without that: packets missing, no trailer, or an error status from the device. Counted whether or not the stream delivers incomplete frames.

§frames_missed: u64

Blocks never seen at all: gaps in the block-id sequence.

§frames_backpressure: u64

Frames assembled and then discarded because the application did not take them before the delivery queue filled.

§frames_unsupported: u64

Blocks whose payload type the engine does not assemble.

§packets_received: u64

Datagrams read from the socket. USB3 Vision: bulk transfers.

§packets_missing: u64

Packets never received, of frames closed incomplete. A lower bound when a trailer is missing, since the trailer is what says how many there were.

§packets_duplicate: u64

Packets received more than once.

§packets_ignored: u64

Packets received and not used, for any reason: not GVSP, a format the engine does not assemble, beyond the end of the frame, late, an error status, or from an address other than the camera’s.

§resend_requested: u64

Packets asked for again, each counted once however often it was asked.

§resend_recovered: u64

Packets asked for again that then arrived.

§resend_unavailable: u64

Packets asked for again that the camera answered it no longer has.

§transfer_errors: u64

USB3 Vision: transfers that failed — a stall, a fault — and that the stream recovered from by resetting its endpoint, at the cost of the block in progress. 0 on GigE Vision.

§bytes: u64

Payload bytes of complete frames handed to the application.

§avg_mbps: f64

Smoothed payload throughput of complete frames, in megabits a second.

§avg_latency_ms: Option<f64>

Smoothed delay from the device timestamp to delivery, in milliseconds, when the stream can map device time to host time.

§elapsed_ms: u64

Time since the stream started, in milliseconds.

Implementations§

Source§

impl StreamCounters

Source

pub fn frames_lost(&self) -> u64

Frames the application did not receive complete: incomplete, missed and dropped to backpressure.

Trait Implementations§

Source§

impl Clone for StreamCounters

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for StreamCounters

Source§

impl Debug for StreamCounters

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for StreamCounters

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for StreamCounters

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl From<&StreamStats> for StreamCounters

Available on crate feature genicam only.
Source§

fn from(stats: &StreamStats) -> Self

Converts to this type from the input type.
Source§

impl PartialEq for StreamCounters

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl Serialize for StreamCounters

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for StreamCounters

Source§

impl TS for StreamCounters

Source§

type WithoutGenerics = StreamCounters

If this type does not have generic parameters, then WithoutGenerics should just be Self. If the type does have generic parameters, then all generic parameters must be replaced with a dummy type, e.g ts_rs::Dummy or ().
The only requirement for these dummy types is that EXPORT_TO must be None. Read more
Source§

type OptionInnerType = StreamCounters

If the implementing type is std::option::Option<T>, then this associated type is set to T. All other implementations of TS should set this type to Self instead.
Source§

fn ident(cfg: &Config) -> String

Identifier of this type, excluding generic parameters.
Source§

fn docs() -> Option<String>

JSDoc comment to describe this type in TypeScript - when TS is derived, docs are automatically read from your doc comments or #[doc = ".."] attributes
Source§

fn name(cfg: &Config) -> String

Name of this type in TypeScript, including generic parameters
Source§

fn decl_concrete(cfg: &Config) -> String

Declaration of this type using the supplied generic arguments. The resulting TypeScript definition will not be generic. For that, see TS::decl(). If this type is not generic, then this function is equivalent to TS::decl().
Source§

fn decl(cfg: &Config) -> String

Declaration of this type, e.g. type User = { user_id: number, ... }. This function will panic if the type has no declaration. Read more
Source§

fn inline(cfg: &Config) -> String

Formats this types definition in TypeScript, e.g { user_id: number }. This function will panic if the type cannot be inlined.
Source§

fn inline_flattened(cfg: &Config) -> String

Flatten a type declaration. This function will panic if the type cannot be flattened.
Source§

fn visit_generics(v: &mut impl TypeVisitor)
where Self: 'static,

Iterates over all type parameters of this type.
Source§

fn output_path() -> Option<PathBuf>

Returns the output path to where T should be exported, relative to the output directory. The returned path does not include any base directory. Read more
Source§

fn visit_dependencies(v: &mut impl TypeVisitor)
where Self: 'static,

Iterates over all dependency of this type.
§

fn dependencies(cfg: &Config) -> Vec<Dependency>
where Self: 'static,

Resolves all dependencies of this type recursively.
§

fn export(cfg: &Config) -> Result<(), ExportError>
where Self: 'static,

Manually export this type to the filesystem. To export this type together with all of its dependencies, use [TS::export_all]. Read more
§

fn export_all(cfg: &Config) -> Result<(), ExportError>
where Self: 'static,

Manually export this type to the filesystem, together with all of its dependencies. To export only this type, without its dependencies, use [TS::export]. Read more
§

fn export_to_string(cfg: &Config) -> Result<String, ExportError>
where Self: 'static,

Manually generate bindings for this type, returning a String. This function does not format the output, even if the format feature is enabled. 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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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