Struct e_ring::Ring[][src]

pub struct Ring<T, const N: usize> { /* fields omitted */ }
Expand description

Append only data structure, replace oldest element when reach maximum capacity of N elements

Implementations

Calculate the average of the elements in the Ring

Calculate the variance of the elements in the Ring, use provided avg if Some, otherwise it calculates it (in the latter case two iterations are required).

Returns an iterator over the Ring on which values are rescaled according to the desired range

Creates a new Ring of give size N

Append an element to the Ring, if there are already N elements, it replaces the oldest.

Number of elements in the Ring, it never decreases.

If the Ring is empty. Zero elements

Return the max size of the ring

Return the last item inserted

Returns an iterator over the Ring starting from the oldest appended element

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

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

calculate min and max with one iteration

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

Performs the conversion.

Performs the conversion.

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.