pub trait Indexable<T>: Send + Sync {
// Required methods
fn get(&self, i: usize) -> &[T];
fn len(&self) -> usize;
// Provided method
fn is_empty(&self) -> bool { ... }
}Expand description
A trait representing a dataset that can be accessed into vector chunks.
This abstracts over the actual memory layout of the dataset, allowing the knn function
to seamlessly map over a sliced array (&[T], dim), vectors of vectors Vec<Vec<T>>,
or arrays of references Vec<&[T]>.
Required Methods§
Provided Methods§
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".