Skip to main content

BoundedTelemetryQueue

Struct BoundedTelemetryQueue 

Source
pub struct BoundedTelemetryQueue { /* private fields */ }
Expand description

Fixed-capacity non-blocking drop-oldest telemetry ring queue with zero heap allocation on hot-path push.

Implementations§

Source§

impl BoundedTelemetryQueue

Zero-allocation hot-path push and low-frequency aggregation helpers for BoundedTelemetryQueue.

Source

pub fn with_capacity(capacity: usize) -> Self

Pre-allocates a fixed-capacity ring buffer (>= 1) so subsequent push calls perform zero heap allocation.

§Arguments
  • usize - Fixed slot capacity.
§Returns
  • Self - Ready ring queue.
Source

pub fn push(&mut self, sample: TelemetrySample) -> bool

Pushes sample without blocking or heap allocation, overwriting the oldest sample when full.

§Arguments
  • &Self - Mutable telemetry queue.
  • TelemetrySample - Sample capturing reused callback/present timestamps.
§Returns
  • bool - true when stored without dropping; false when the oldest sample was evicted.
Source

pub fn drain_into(&mut self, out: &mut Vec<TelemetrySample>) -> usize

Drains all currently queued samples in FIFO order into out and resets the ring cursor.

§Arguments
  • &Self - Mutable telemetry queue.
  • &mut Vec<TelemetrySample> - Destination vector.
§Returns
  • usize - Number of samples drained.
Source

pub fn aggregate_and_drain(&mut self) -> AggregatedTelemetryWindow

Aggregates all queued samples in a single low-frequency batch without pixel readback or GPU wait.

§Arguments
  • &Self - Mutable telemetry queue.
§Returns
  • AggregatedTelemetryWindow - Aggregated presentation interval and latency percentiles.
Source§

impl BoundedTelemetryQueue

Source

pub fn get_slots(&self) -> &Vec<TelemetrySample>

Source

pub fn get_mut_slots(&mut self) -> &mut Vec<TelemetrySample>

Source

pub fn set_slots(&mut self, val: Vec<TelemetrySample>) -> &mut Self

Source

pub fn get_head(&self) -> usize

Source

pub fn get_mut_head(&mut self) -> &mut usize

Source

pub fn set_head(&mut self, val: usize) -> &mut Self

Source

pub fn get_len(&self) -> usize

Source

pub fn get_mut_len(&mut self) -> &mut usize

Source

pub fn set_len(&mut self, val: usize) -> &mut Self

Source

pub fn get_capacity(&self) -> usize

Source

pub fn get_mut_capacity(&mut self) -> &mut usize

Source

pub fn set_capacity(&mut self, val: usize) -> &mut Self

Source

pub fn get_dropped_oldest_count(&self) -> u64

Source

pub fn get_mut_dropped_oldest_count(&mut self) -> &mut u64

Source

pub fn set_dropped_oldest_count(&mut self, val: u64) -> &mut Self

Trait Implementations§

Source§

impl Clone for BoundedTelemetryQueue

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

Source§

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

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

impl Default for BoundedTelemetryQueue

Default pre-allocated BoundedTelemetryQueue.

Source§

fn default() -> Self

Creates a pre-allocated ring queue with DEFAULT_TELEMETRY_QUEUE_CAPACITY slots.

§Returns
  • Self - Pre-allocated telemetry queue.
Source§

impl PartialEq for BoundedTelemetryQueue

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 StructuralPartialEq for BoundedTelemetryQueue

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

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.