pub enum CentroidStore {
Owned(Array2<f32>),
}Expand description
Storage backend for centroids, supporting both owned arrays and memory-mapped files.
This enum enables ResidualCodec to work with centroids stored either:
- In memory as an owned
Array2<f32>(default, forIndexandLoadedIndex) - Memory-mapped from disk (for
MmapIndex, reducing RAM usage)
Variants§
Implementations§
Source§impl CentroidStore
impl CentroidStore
Sourcepub fn view(&self) -> ArrayView2<'_, f32>
pub fn view(&self) -> ArrayView2<'_, f32>
Get a view of the centroids as ArrayView2.
This is zero-copy for both owned and mmap variants.
Sourcepub fn row(&self, idx: usize) -> ArrayView1<'_, f32>
pub fn row(&self, idx: usize) -> ArrayView1<'_, f32>
Get a view of a single centroid row.
Sourcepub fn slice_rows(&self, start: usize, end: usize) -> ArrayView2<'_, f32>
pub fn slice_rows(&self, start: usize, end: usize) -> ArrayView2<'_, f32>
Get a view of rows [start..end] as ArrayView2.
This is zero-copy for both owned and mmap variants.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for CentroidStore
impl RefUnwindSafe for CentroidStore
impl Send for CentroidStore
impl Sync for CentroidStore
impl Unpin for CentroidStore
impl UnwindSafe for CentroidStore
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more