pub struct Collection { /* private fields */ }Expand description
A collection of vectors with associated metadata.
Implementations§
Source§impl Collection
impl Collection
Sourcepub fn create(
path: PathBuf,
dimension: usize,
metric: DistanceMetric,
) -> Result<Self>
pub fn create( path: PathBuf, dimension: usize, metric: DistanceMetric, ) -> Result<Self>
Creates a new collection at the specified path.
§Errors
Returns an error if the directory cannot be created or the config cannot be saved.
Sourcepub fn open(path: PathBuf) -> Result<Self>
pub fn open(path: PathBuf) -> Result<Self>
Opens an existing collection from the specified path.
§Errors
Returns an error if the config file cannot be read or parsed.
Sourcepub fn config(&self) -> CollectionConfig
pub fn config(&self) -> CollectionConfig
Returns the collection configuration.
Sourcepub fn upsert(&self, points: Vec<Point>) -> Result<()>
pub fn upsert(&self, points: Vec<Point>) -> Result<()>
Inserts or updates points in the collection.
§Errors
Returns an error if any point has a mismatched dimension.
Trait Implementations§
Source§impl Clone for Collection
impl Clone for Collection
Source§fn clone(&self) -> Collection
fn clone(&self) -> Collection
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for Collection
impl !RefUnwindSafe for Collection
impl Send for Collection
impl Sync for Collection
impl Unpin for Collection
impl !UnwindSafe for Collection
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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