Skip to main content

StreamStats

Struct StreamStats 

Source
pub struct StreamStats {
    pub pushed: u64,
    pub accepted: u64,
    pub yielded: u64,
    pub dropped_newest: u64,
    pub dropped_oldest: u64,
    pub overflow_errors: u64,
    pub rejected: u64,
    pub timeouts: u64,
    pub timed_out: u64,
    pub blocked: u64,
    pub closed: bool,
    pub cancelled: bool,
}
Expand description

Lifetime counters observed on a stream spine.

Every field accumulates over the life of the stream and is snapshotted by StreamValue::stats; the two boolean flags record terminal state. The counters are advanced by the queue as packets are pushed, yielded, dropped, or rejected, giving a behavioral record of how backpressure played out.

Fields§

§pushed: u64

Total packets handed to the spine via push, regardless of outcome.

§accepted: u64

Packets admitted to the queue (excludes drops, rejects, and closed pushes).

§yielded: u64

Packets pulled out of the spine and handed to a consumer.

§dropped_newest: u64

Packets dropped on overflow under the drop-newest policy.

§dropped_oldest: u64

Packets evicted from the front on overflow under the drop-oldest policy.

§overflow_errors: u64

Overflows that occurred while the error policy was in force.

§rejected: u64

Pushes refused (returned as PushResult::Rejected).

§timeouts: u64

Timed waits that elapsed without a packet becoming available.

§timed_out: u64

Timed pulls that returned empty because the wait timed out.

§blocked: u64

Pulls that had to block waiting for a packet.

§closed: bool

Whether the stream has been closed to further input.

§cancelled: bool

Whether the stream was cancelled (closed and drained of buffered items).

Trait Implementations§

Source§

impl Clone for StreamStats

Source§

fn clone(&self) -> StreamStats

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 Debug for StreamStats

Source§

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

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

impl Default for StreamStats

Source§

fn default() -> StreamStats

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

impl Eq for StreamStats

Source§

impl PartialEq for StreamStats

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl StructuralPartialEq for StreamStats

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
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> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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.

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 = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.