Skip to main content

TelemetryBlock

Struct TelemetryBlock 

Source
#[repr(C)]
pub struct TelemetryBlock<T, const BUF_SIZE: usize>
where T: Transcendental,
{ pub node_id: NodeId, pub channel: u32, pub timestamp: u64, pub sample_rate: f32, pub block_index: u64, pub peak: T, pub rms: T, pub dc_offset: T, pub data: [T; BUF_SIZE], }
Expand description

Fixed-size telemetry frame for RT-safe ring buffer communication.

Contains a full signal block plus computed metrics (peak, RMS, DC offset). Implements Copy + Default, compatible with SpscQueue (overwrite-oldest).

Fields§

§node_id: NodeId

Source node identifier

§channel: u32

Audio channel index

§timestamp: u64

Timestamp (microseconds since UNIX epoch)

§sample_rate: f32

Sample rate at capture time

§block_index: u64

Monotonic block counter

§peak: T

Peak amplitude of the block

§rms: T

RMS (root mean square) of the block

§dc_offset: T

DC offset (average) of the block

§data: [T; BUF_SIZE]

Full signal block data

Implementations§

Source§

impl<T, const BUF_SIZE: usize> TelemetryBlock<T, BUF_SIZE>
where T: Transcendental,

Source

pub fn compute_metrics(&mut self)

Compute metrics (peak, RMS, DC offset) from the block data.

Trait Implementations§

Source§

impl<T, const BUF_SIZE: usize> Clone for TelemetryBlock<T, BUF_SIZE>
where T: Clone + Transcendental,

Source§

fn clone(&self) -> TelemetryBlock<T, BUF_SIZE>

Returns a duplicate of the value. Read more
1.0.0 · Source§

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

Performs copy-assignment from source. Read more
Source§

impl<T, const BUF_SIZE: usize> Debug for TelemetryBlock<T, BUF_SIZE>
where T: Debug + Transcendental,

Source§

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

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

impl<T, const BUF_SIZE: usize> Default for TelemetryBlock<T, BUF_SIZE>
where T: Transcendental,

Source§

fn default() -> TelemetryBlock<T, BUF_SIZE>

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

impl<T, const BUF_SIZE: usize> Copy for TelemetryBlock<T, BUF_SIZE>
where T: Copy + Transcendental,

Auto Trait Implementations§

§

impl<T, const BUF_SIZE: usize> Freeze for TelemetryBlock<T, BUF_SIZE>
where T: Freeze,

§

impl<T, const BUF_SIZE: usize> RefUnwindSafe for TelemetryBlock<T, BUF_SIZE>
where T: RefUnwindSafe,

§

impl<T, const BUF_SIZE: usize> Send for TelemetryBlock<T, BUF_SIZE>

§

impl<T, const BUF_SIZE: usize> Sync for TelemetryBlock<T, BUF_SIZE>

§

impl<T, const BUF_SIZE: usize> Unpin for TelemetryBlock<T, BUF_SIZE>
where T: Unpin,

§

impl<T, const BUF_SIZE: usize> UnsafeUnpin for TelemetryBlock<T, BUF_SIZE>
where T: UnsafeUnpin,

§

impl<T, const BUF_SIZE: usize> UnwindSafe for TelemetryBlock<T, BUF_SIZE>
where T: UnwindSafe,

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> AsAny for T
where T: 'static,

Source§

fn as_any(&self) -> &(dyn Any + 'static)

Convert to &dyn std::any::Any
Source§

fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)

Convert to &mut dyn std::any::Any
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.