pub trait Sampler<T> {
type BatchData;
// Required method
fn sample(&self, data: Vec<T>) -> Vec<Self::BatchData>;
// Provided methods
fn sample_slice(&self, data: &[T]) -> Vec<Self::BatchData>
where T: Clone { ... }
fn sample_iter<I>(&self, data: I) -> Vec<Self::BatchData>
where I: IntoIterator<Item = T> { ... }
}Expand description
Trait for sampling data into batches.
This trait defines the interface for sampling data into batches for processing.
Required Associated Types§
Required Methods§
Provided Methods§
Sourcefn sample_iter<I>(&self, data: I) -> Vec<Self::BatchData>where
I: IntoIterator<Item = T>,
fn sample_iter<I>(&self, data: I) -> Vec<Self::BatchData>where
I: IntoIterator<Item = T>,
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.