Trait BatchBase

Source
pub trait BatchBase {
    // Required methods
    fn new(capacity: usize) -> Self;
    fn push(&mut self, ix: usize, data: Self);
    fn sample(&self, ixs: &Vec<usize>) -> Self;
}
Expand description

A generic implementation of a batch of items.

Required Methods§

Source

fn new(capacity: usize) -> Self

Builds a subbatch with a capacity.

Source

fn push(&mut self, ix: usize, data: Self)

Pushes the samples in data.

Source

fn sample(&self, ixs: &Vec<usize>) -> Self

Takes samples in the batch.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§