pub struct IdMap<I> { /* private fields */ }
Expand description

Wrapper for implementing arbitrary ID mapping to an index.

See the module level documentation for more information.

Implementations

Augment an index with arbitrary ID mapping.

Retrieve a slice of the internal ID map.

Obtain the raw pointer to the internal index.

Safety

While this method is safe, note that the returned index pointer is already owned by this ID map. Therefore, it is undefined behavior to create a high-level index value from this pointer without first decoupling this ownership. See [into_inner] for a safe alternative.

Discard the ID map, recovering the index originally created without it.

Discard the ID map, recovering the index originally created without it. Safety build managed index from pointer.

Specialization of the index type inside IdMap.

Trait Implementations

Similar to search, but only provides the labels.

Perform a search for the k closest vectors to the given query vectors.

Perform a ranged search for the vectors closest to the given query vectors by the given radius. Read more

Formats the value using the given formatter. Read more

Executes the destructor for this type. Read more

Whether the Index does not require training, or if training is done already

The total number of vectors indexed

The dimensionality of the indexed vectors

The metric type assumed by the index

Add new data vectors to the index. This assumes a C-contiguous memory slice of vectors, where the total number of vectors is x.len() / d. Read more

Add new data vectors to the index with IDs. This assumes a C-contiguous memory slice of vectors, where the total number of vectors is x.len() / d. Not all index types may support this operation. Read more

Train the underlying index with the given data.

Similar to search, but only provides the labels.

Perform a search for the k closest vectors to the given query vectors.

Perform a ranged search for the vectors closest to the given query vectors by the given radius. Read more

Clear the entire index.

Remove data vectors represented by IDs.

Index verbosity level

Set Index verbosity level

Retrieve a pointer to the native index object.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

Convert an index to the base IndexImpl type