Skip to main content

LatencyStreamOps

Trait LatencyStreamOps 

Source
pub trait LatencyStreamOps<P>
where P: Element + HasLatency,
{ // Required methods fn stamp<S>(self: &Rc<Self>) -> Rc<dyn Stream<P>> where S: Stage<P::L> + 'static; fn stamp_if<S>(self: &Rc<Self>, enabled: bool) -> Rc<dyn Stream<P>> where S: Stage<P::L> + 'static; fn stamp_precise<S>(self: &Rc<Self>) -> Rc<dyn Stream<P>> where S: Stage<P::L> + 'static; fn stamp_precise_if<S>(self: &Rc<Self>, enabled: bool) -> Rc<dyn Stream<P>> where S: Stage<P::L> + 'static; }
Expand description

Extension trait adding .stamp::<Stage>() and friends to streams whose values carry a Latency record.

Required Methods§

Source

fn stamp<S>(self: &Rc<Self>) -> Rc<dyn Stream<P>>
where S: Stage<P::L> + 'static,

Wrap this stream in a StampStream for stage S. Each tick writes GraphState::wall_time (cycle-start snap, one u64 store) into the stage’s slot before forwarding.

Source

fn stamp_if<S>(self: &Rc<Self>, enabled: bool) -> Rc<dyn Stream<P>>
where S: Stage<P::L> + 'static,

Conditional variant of stamp. When enabled is false, returns self unchanged — no node is inserted into the graph and there is zero runtime cost. Useful for flipping stamping on/off at graph-construction time via a config flag.

Source

fn stamp_precise<S>(self: &Rc<Self>) -> Rc<dyn Stream<P>>
where S: Stage<P::L> + 'static,

Like stamp but uses GraphState::wall_time_precise (fresh TSC read, ~5-10ns) for intra-cycle resolution.

Source

fn stamp_precise_if<S>(self: &Rc<Self>, enabled: bool) -> Rc<dyn Stream<P>>
where S: Stage<P::L> + 'static,

Conditional variant of stamp_precise.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<P> LatencyStreamOps<P> for dyn Stream<P>
where P: Element + HasLatency + 'static,