pub struct Windowing<P> { /* private fields */ }
Expand description

Windowing is a mechanism for rotating between different observations. It provides an accessor Windowing::current for the current observation, and a method Windowing::cycle_windows which makes the next observation in the ring current, and returns the observation which was current prior to the call.

Implementations

Constructor. Initializes its owned ring of Ps using Default::default().

Get the current collection. The underling P is expected to be cycled on some regular interval.

Data integrity guarantees are weak. In some circumstances, the returned P window may be for the prior interval, if whatever wants to write a datapoint races with something replacing the current P. It is even possible (if extremely unlikely) for a value to be written into an old P collection, if the writer races with a reader and writes after the reader has emptied the collection and released its lock.

Cycle to the next window. Returns the window which was active before the call.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.