Struct sliding_windows::Storage
[−]
[src]
pub struct Storage<T> {
// some fields omitted
}This holds the backing allocation for the Window of a Adaptor.
See sliding_windows for more information.
Methods
impl<T> Storage<T>
fn new(window_size: usize) -> Storage<T>
Create a new Storage with a given window size.
This will allocate twice as much memory as is needed to store the Window for performance reasons.
If you want to use as few memory as possible, but more CPU, consider using Storage::new_exact() instead.
See sliding_windows for more information.
fn new_exact(window_size: usize) -> Storage<T>
Create a new Storage with a given window size.
This will allocate as much memory as is needed to store the Window automatically.
See sliding_windows for more information.
fn from_vec<S: Into<Vec<T>>>(vec: S, window_size: usize) -> Storage<T>
Create a new Storage with a given window size from a given struct implementing Into<Vec>.
The contents of the Vec will be removed.
This will reuse the allocation of the Vec instead of allocating new memory.
See sliding_windows for more information.