Struct lance_index::vector::graph::memory::InMemoryVectorStorage
source · pub struct InMemoryVectorStorage { /* private fields */ }Expand description
All data are stored in memory
Implementations§
source§impl InMemoryVectorStorage
impl InMemoryVectorStorage
pub fn new( vectors: Arc<MatrixView<Float32Type>>, metric_type: MetricType ) -> Self
pub fn vector(&self, id: u32) -> &[f32]
sourcepub fn distance_between(&self, a: u32, b: u32) -> f32
pub fn distance_between(&self, a: u32, b: u32) -> f32
Distance between two vectors.
Trait Implementations§
source§impl VectorStorage for InMemoryVectorStorage
impl VectorStorage for InMemoryVectorStorage
fn as_any(&self) -> &dyn Any
fn len(&self) -> usize
fn row_ids(&self) -> &[u64]
source§fn metric_type(&self) -> MetricType
fn metric_type(&self) -> MetricType
Return the metric type of the vectors.
Auto Trait Implementations§
impl Freeze for InMemoryVectorStorage
impl RefUnwindSafe for InMemoryVectorStorage
impl Send for InMemoryVectorStorage
impl Sync for InMemoryVectorStorage
impl Unpin for InMemoryVectorStorage
impl UnwindSafe for InMemoryVectorStorage
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> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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