pub struct VectorIndex { /* private fields */ }Expand description
Built-in vector index state for one (label, property) registration.
Implementations§
Source§impl VectorIndex
impl VectorIndex
Sourcepub fn new(kind: VectorIndexKind, dimension: u32) -> GraphResult<Self>
pub fn new(kind: VectorIndexKind, dimension: u32) -> GraphResult<Self>
Construct an empty vector index.
§Errors
Returns GraphError::VectorIndexInvalidDimension when dimension is
zero.
Sourcepub fn new_with_hnsw_config(
kind: VectorIndexKind,
dimension: u32,
hnsw_config: Option<HnswIndexConfig>,
) -> GraphResult<Self>
pub fn new_with_hnsw_config( kind: VectorIndexKind, dimension: u32, hnsw_config: Option<HnswIndexConfig>, ) -> GraphResult<Self>
Construct an empty vector index with optional HNSW configuration.
§Errors
Returns GraphError::VectorIndexInvalidDimension when dimension is
zero, or GraphError::VectorIndexInvalidHnswConfig when the supplied
HNSW parameters are invalid for the chosen kind.
Sourcepub fn new_with_configs(
kind: VectorIndexKind,
dimension: u32,
hnsw_config: Option<HnswIndexConfig>,
ivf_config: Option<IvfIndexConfig>,
) -> GraphResult<Self>
pub fn new_with_configs( kind: VectorIndexKind, dimension: u32, hnsw_config: Option<HnswIndexConfig>, ivf_config: Option<IvfIndexConfig>, ) -> GraphResult<Self>
Construct an empty vector index with optional ANN construction config.
§Errors
Returns GraphError::VectorIndexInvalidDimension when dimension is
zero, GraphError::VectorIndexInvalidHnswConfig when supplied HNSW
parameters are invalid for the chosen kind, or
GraphError::VectorIndexInvalidIvfConfig when supplied IVF parameters
are invalid for the chosen kind.
Sourcepub const fn kind(&self) -> VectorIndexKind
pub const fn kind(&self) -> VectorIndexKind
Return the vector index algorithm kind.
Sourcepub const fn hnsw_config(&self) -> Option<HnswIndexConfig>
pub const fn hnsw_config(&self) -> Option<HnswIndexConfig>
Return the HNSW construction config, if this is an HNSW index.
Sourcepub const fn ivf_config(&self) -> Option<IvfIndexConfig>
pub const fn ivf_config(&self) -> Option<IvfIndexConfig>
Return the IVF construction config, if this is a configured IVF index.
Sourcepub fn cardinality(&self) -> u64
pub fn cardinality(&self) -> u64
Return the number of indexed rows.
Sourcepub const fn rows(&self) -> &RoaringBitmap
pub const fn rows(&self) -> &RoaringBitmap
Borrow the indexed row bitmap.
Sourcepub const fn is_turbo_quant(&self) -> bool
pub const fn is_turbo_quant(&self) -> bool
Return true when this index has a TurboQuant compressed accelerator.
Sourcepub const fn hnsw_metric(&self) -> Option<VectorMetric>
pub const fn hnsw_metric(&self) -> Option<VectorMetric>
Return the HNSW metric, if this is an HNSW index.
Sourcepub const fn ann_metric(&self) -> Option<VectorMetric>
pub const fn ann_metric(&self) -> Option<VectorMetric>
Return the ANN metric, if this is an approximate index.
Sourcepub fn memory_usage(&self) -> VectorIndexMemoryUsage
pub fn memory_usage(&self) -> VectorIndexMemoryUsage
Return an estimated memory usage snapshot for this index.
Trait Implementations§
Source§impl Clone for VectorIndex
impl Clone for VectorIndex
Source§fn clone(&self) -> VectorIndex
fn clone(&self) -> VectorIndex
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for VectorIndex
impl RefUnwindSafe for VectorIndex
impl Send for VectorIndex
impl Sync for VectorIndex
impl Unpin for VectorIndex
impl UnsafeUnpin for VectorIndex
impl UnwindSafe for VectorIndex
Blanket Implementations§
Source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
Source§type ArchivedMetadata = ()
type ArchivedMetadata = ()
Source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
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>
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 moreSource§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
Source§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Source§impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
Source§unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
Source§fn resolve_niched(out: Place<NichedOption<T, N1>>)
fn resolve_niched(out: Place<NichedOption<T, N1>>)
out indicating that a T is niched.