[][src]Struct cxmr_snapshots::SnapshotCollector

pub struct SnapshotCollector { /* fields omitted */ }

Snapshot collector.

Methods

impl SnapshotCollector[src]

pub fn new(interval: u64) -> Self[src]

Creates snapshot collector with interval.

pub fn finish(self) -> Option<State>[src]

Returns last state.

pub fn try_pop(&mut self, ts: u64) -> Option<State>[src]

Pops state from collector if timestamp can close the candle.

pub fn update(&mut self, event: &EventData) -> Option<State>[src]

Collects data into a snapshot and returns if state is filled.

pub fn consume(self, events: &Vec<EventData>) -> Option<Snapshot>[src]

Creates a snapshot from data rows. Returns None if input is empty vector.

pub fn consume_close(self, events: &Vec<EventData>) -> Option<Snapshot>[src]

Creates a snapshot from data rows. Filters close state only. Returns None if input is empty vector.

Trait Implementations

impl Default for SnapshotCollector[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.