Skip to main content

AsyncQuantLoadContext

Struct AsyncQuantLoadContext 

Source
pub struct AsyncQuantLoadContext {
    pub metadata: AsyncIndexMetadata,
    pub num_frozen_points: NonZeroUsize,
    pub metric: Metric,
    pub prefetch_lookahead: Option<usize>,
    pub is_disk_index: bool,
    pub prefetch_cache_line_level: Option<PrefetchCacheLineLevel>,
}
Expand description

Indicates that the canonical layout for a Quant index is expected for deserialization.

For a file-path prefix prefix, this layout includes the following files:

Common:

  • prefix: The file that contains the saved graph.
  • prefix.data: The serialized full-precision data in .bin form.

Depending on the quantization method used, one of the following sets of files will also be present:

If Product Quantization (PQ) is used:

  • prefix_build_pq_pivots.bin: The saved PQ pivot table.
  • prefix_build_pq_compressed.bin: The saved PQ codes.

If Scalar Quantization (SQ) is used:

  • prefix_sq_compressed.bin: The saved scalar quantized codes.
  • prefix_scalar_quantizer_proto.bin: The saved scalar quantizer metadata.

Fields§

§metadata: AsyncIndexMetadata

The file path prefix of the index.

§num_frozen_points: NonZeroUsize

The number of frozen points stored in the datasets.

§metric: Metric

The metric to use for this index.

§prefetch_lookahead: Option<usize>

The number of iterations to prefetch when performing bulk-retrievals.

§is_disk_index: bool

Temporary parameter to indicate if the index is a disk index to load right file names. This can be removed once disk index uses same file names as async index.

§prefetch_cache_line_level: Option<PrefetchCacheLineLevel>

controls the prefetch cache line level for the index.

Trait Implementations§

Source§

impl LoadWith<AsyncQuantLoadContext> for NoStore

Source§

type Error = ANNError

The error type if deserialization is unsuccessful.
Source§

async fn load_with<P>(_: &P, _: &AsyncQuantLoadContext) -> ANNResult<Self>

Load self form disk using provider for IO-related needs. Argument auxiliary can be arbitrary metadata required for a successful operation, such as file paths.
Source§

impl<T> LoadWith<AsyncQuantLoadContext> for MemoryVectorProviderAsync<T>
where T: VectorRepr,

Source§

async fn load_with<P>( provider: &P, ctx: &AsyncQuantLoadContext, ) -> ANNResult<Self>

Load the dataset to a file beginning with the prefix and ending in .data.

The format of the serialized should be in the traditional .bin format.

Source§

type Error = ANNError

The error type if deserialization is unsuccessful.
Source§

impl LoadWith<AsyncQuantLoadContext> for MemoryQuantVectorProviderAsync

Source§

async fn load_with<P>( provider: &P, ctx: &AsyncQuantLoadContext, ) -> ANNResult<Self>

Load the quant vector provider using the prefix in ctx~ as a prefix to [PQPathNames`] along with the number of PQ bytes.

Source§

type Error = ANNError

The error type if deserialization is unsuccessful.
Source§

impl LoadWith<AsyncQuantLoadContext> for SimpleNeighborProviderAsync

This is an adaptor for compatibility with the async index serialization.

Source§

type Error = ANNError

The error type if deserialization is unsuccessful.
Source§

async fn load_with<P>( provider: &P, ctx: &AsyncQuantLoadContext, ) -> ANNResult<Self>

Load self form disk using provider for IO-related needs. Argument auxiliary can be arbitrary metadata required for a successful operation, such as file paths.
Source§

impl<T> LoadWith<AsyncQuantLoadContext> for FastMemoryVectorProviderAsync<T>
where T: VectorRepr,

Source§

async fn load_with<P>( provider: &P, ctx: &AsyncQuantLoadContext, ) -> ANNResult<Self>

Load the dataset to a file beginning with the prefix and ending in .data.

The format of the serialized should be in the traditional .bin format.

Source§

type Error = ANNError

The error type if deserialization is unsuccessful.
Source§

impl LoadWith<AsyncQuantLoadContext> for FastMemoryQuantVectorProviderAsync

Source§

async fn load_with<P>( provider: &P, ctx: &AsyncQuantLoadContext, ) -> ANNResult<Self>

Load the quant vector provider using the prefix in ctx~ as a prefix to [PQPathNames`] along with the number of PQ bytes.

Source§

type Error = ANNError

The error type if deserialization is unsuccessful.
Source§

impl<U, V, D, Ctx> LoadWith<AsyncQuantLoadContext> for DefaultProvider<U, V, D, Ctx>

Source§

type Error = ANNError

The error type if deserialization is unsuccessful.
Source§

async fn load_with<P>( provider: &P, ctx: &AsyncQuantLoadContext, ) -> ANNResult<Self>

Load self form disk using provider for IO-related needs. Argument auxiliary can be arbitrary metadata required for a successful operation, such as file paths.
Source§

impl<const NBITS: usize> LoadWith<AsyncQuantLoadContext> for SQStore<NBITS>
where Unsigned: Representation<NBITS>,

Source§

type Error = ANNError

The error type if deserialization is unsuccessful.
Source§

async fn load_with<P>( read_provider: &P, ctx: &AsyncQuantLoadContext, ) -> ANNResult<Self>

Load self form disk using provider for IO-related needs. Argument auxiliary can be arbitrary metadata required for a successful operation, such as file paths.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> AsyncFriendly for T
where T: Send + Sync + 'static,

Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

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

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more