Skip to main content

CumulativeMax

Struct CumulativeMax 

Source
pub struct CumulativeMax;
Expand description

Cumulative maximum over every sample seen so far — a running extreme, O(1) per tick. Option state seeds on the first sample (see CumulativeMin). Mirrors the legacy max(Window::Unbounded).

Trait Implementations§

Source§

impl Op for CumulativeMax

Source§

type State = Option<f64>

The running maximum; None until the first sample seeds it.

Source§

const ACTIVATION: Activation = Activation::NONE

How this op is scheduled, declared statically so the engines can read it at wiring time rather than infer it. See Activation.
Source§

type Cfg = ()

Construction-time configuration, closures included — a map’s F is its Cfg. Built at wiring, owned by the engine, handed to every lifecycle function by &mut. () for an op that needs none.
Source§

type In<'a> = (&'a f64,)

The typed inputs for one cycle — upstream values by reference, plus a bool tick flag wherever the op needs to know which input fired ((&T, bool)). A tuple for a fixed-arity op, a slice for a variadic one, () for a source. The engine assembles it; ops never reach upstream themselves.
Source§

type Out = f64

The value this op produces, i.e. what its downstream sees.
Source§

fn cycle( _cfg: &mut (), state: &mut Option<f64>, input: (&f64,), _ctx: &mut Ctx<'_>, ) -> Result<Tick<f64>>

Run one cycle: the op’s whole semantics, and the only function that must be written. Returns Tick::Value to produce and propagate, Tick::Silent to update the value slot without waking downstream, or Tick::Quiet to do neither. Err aborts the run with node context.
Source§

fn start( cfg: &mut Self::Cfg, state: &mut Self::State, ctx: &mut Ctx<'_>, ) -> Result<()>

Called once before the first cycle. Sources use this to schedule their first activation; IO ops open resources here.
Source§

fn stop( cfg: &mut Self::Cfg, state: &mut Self::State, ctx: &mut Ctx<'_>, ) -> Result<()>

Called once after the last cycle, before teardown. Runs even if a cycle aborted the run, so ops can flush or unwind cleanly. A stop error is reported but does not mask an earlier cycle error.
Source§

fn teardown( cfg: &mut Self::Cfg, state: &mut Self::State, ctx: &mut Ctx<'_>, ) -> Result<()>

Called once at the very end of the run, after stop. The place to release resources (close sockets, files). Also runs after a cycle error.

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

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. 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.