# Struct flechasdb::asyncdb::stored::Database

source ·

    pub struct Database<T, FS>where
        T: Send,
        FS: Send,{ /* private fields */ }

Expand description

Asynchronous database associated with an asynchronous file system.

## Implementations§

source§

### impl<T, FS> Database<T, FS>where T: Send, FS: Send,

source

#### pub const fn vector_size(&self) -> usize

Returns the vector size.

source

#### pub const fn num_partitions(&self) -> usize

Returns the number of partitions.

source

#### pub const fn num_divisions(&self) -> usize

Returns the number of divisions.

source

#### pub const fn num_codes(&self) -> usize

Returns the number of codes.

source§

### impl<'db, T, FS> Database<T, FS>where T: Send, FS: Send, Self: 'db + LoadPartitionCentroids<'db, T>,

source

#### pub fn query<'v, V>( &'db self, v: &'v V, k: NonZeroUsize, nprobe: NonZeroUsize ) -> Query<'db, 'v, T, FS, V, impl FnMut(QueryEvent)> ⓘwhere V: AsSlice<T> + Send + ?Sized,

Queries k-nearest neighbors of a given vector.

source

#### pub fn query_with_events<'v, V, EV>( &'db self, v: &'v V, k: NonZeroUsize, nprobe: NonZeroUsize, event_handler: EV ) -> Query<'db, 'v, T, FS, V, EV> ⓘwhere V: AsSlice<T> + Send + ?Sized, EV: FnMut(QueryEvent),

Queries k-nearest neighbors of a given vector.

## Trait Implementations§

source§

### impl<'db, T, FS> LoadAttributesLog<'db> for Database<T, FS>where T: Send + Sync, FS: FileSystem + Send + Sync, Self: LoadPartition<'db, T> + Sync,

source§

#### fn load_attributes_log<'async_trait>( &'db self, index: usize ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where Self: 'async_trait, 'db: 'async_trait,

Loads the attributes log of a partition in the database. Read more
source§

### impl<FS> LoadCodebook<f32> for Database<f32, FS>where FS: FileSystem + Send + Sync,

source§

#### fn load_codebook<'life0, 'async_trait>( &'life0 self, index: usize ) -> Pin<Box<dyn Future<Output = Result<BlockVectorSet<f32>, Error>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,

Loads a specified codebook of the database. Read more
source§

### impl<FS> LoadDatabase<f32, FS> for Database<f32, FS>where for<'a> FS: 'a + FileSystem + Send + Sync,

source§

#### fn load_database<'async_trait, P>( fs: FS, path: P ) -> Pin<Box<dyn Future<Output = Result<Database<f32, FS>, Error>> + Send + 'async_trait>>where P: Into<String> + Send + 'async_trait,

Loads a database.
source§

### impl<'db, FS> LoadPartition<'db, f32> for Database<f32, FS>where FS: FileSystem + Send + Sync, Self: 'db,

source§

#### fn load_partition<'async_trait>( &'db self, index: usize ) -> Pin<Box<dyn Future<Output = Result<&'db Partition<f32>, Error>> + Send + 'async_trait>>where Self: 'async_trait, 'db: 'async_trait,

Loads a specified partition of the database. Read more
source§

### impl<'db, FS> LoadPartitionCentroids<'db, f32> for Database<f32, FS>where FS: FileSystem + Send + Sync, Self: 'db,

source§

#### fn load_partition_centroids<'async_trait>( &'db self ) -> Pin<Box<dyn Future<Output = Result<&'db BlockVectorSet<f32>, Error>> + Send + 'async_trait>>where Self: 'async_trait, 'db: 'async_trait,

Loads the partition centroids of the database.

## Auto Trait Implementations§

§

### impl<T, FS> !RefUnwindSafe for Database<T, FS>

§

### impl<T, FS> Send for Database<T, FS>

§

### impl<T, FS> Sync for Database<T, FS>where FS: Sync, T: Sync,

§

### impl<T, FS> Unpin for Database<T, FS>where FS: Unpin, T: Unpin,

§

### impl<T, FS> UnwindSafe for Database<T, FS>where FS: UnwindSafe, T: UnwindSafe,

## Blanket Implementations§

source§

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

source§

#### fn type_id(&self) -> TypeId

Gets the `TypeId` of `self`. Read more
source§

### impl<T> Borrow<T> for Twhere T: ?Sized,

source§

#### fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

### impl<T> BorrowMut<T> for Twhere 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, U> Into<U> for Twhere 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, U> TryFrom<U> for Twhere U: Into<T>,

§

#### 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 Twhere U: TryFrom<T>,

§

#### 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.
§

### impl<V, T> VZip<V> for Twhere V: MultiLane<T>,

§

#### fn vzip(self) -> V