Skip to main content

AsyncCollection

Struct AsyncCollection 

Source
pub struct AsyncCollection { /* private fields */ }
Available on crate feature tokio only.
Expand description

Tokio-friendly handle to a Collection. Cheap to clone.

Implementations§

Source§

impl AsyncCollection

Source

pub async fn create_and_open( path: impl Into<String>, schema: CollectionSchema, options: Option<CollectionOptions>, ) -> Result<Self>

Create + open a new collection at path. Takes ownership of schema and options to satisfy 'static bounds on the blocking task.

Source

pub async fn open( path: impl Into<String>, options: Option<CollectionOptions>, ) -> Result<Self>

Open an existing collection at path.

Source

pub fn from_arc(inner: Arc<Collection>) -> Self

Wrap an existing Arc<Collection>. Useful when you already have a shared Collection you want to use from async contexts.

Source

pub fn inner(&self) -> &Arc<Collection>

Access the underlying Arc<Collection>. Escape hatch for callers that need APIs this wrapper doesn’t cover yet.

Source

pub async fn flush(&self) -> Result<()>

Source

pub async fn optimize(&self) -> Result<()>

Source

pub async fn schema(&self) -> Result<CollectionSchema>

Source

pub async fn options(&self) -> Result<CollectionOptions>

Source

pub async fn stats(&self) -> Result<CollectionStats>

Source

pub async fn create_index( &self, field_name: impl Into<String>, params: IndexParams, ) -> Result<()>

Source

pub async fn drop_index(&self, field_name: impl Into<String>) -> Result<()>

Source

pub async fn add_column( &self, field: FieldSchema, expression: Option<String>, ) -> Result<()>

Source

pub async fn drop_column(&self, column_name: impl Into<String>) -> Result<()>

Source

pub async fn alter_column( &self, column_name: impl Into<String>, new_name: Option<String>, new_schema: Option<FieldSchema>, ) -> Result<()>

Source

pub async fn insert(&self, docs: Vec<Doc>) -> Result<WriteSummary>

Source

pub async fn insert_with_results( &self, docs: Vec<Doc>, ) -> Result<Vec<WriteResult>>

Source

pub async fn update(&self, docs: Vec<Doc>) -> Result<WriteSummary>

Source

pub async fn update_with_results( &self, docs: Vec<Doc>, ) -> Result<Vec<WriteResult>>

Source

pub async fn upsert(&self, docs: Vec<Doc>) -> Result<WriteSummary>

Source

pub async fn upsert_with_results( &self, docs: Vec<Doc>, ) -> Result<Vec<WriteResult>>

Source

pub async fn delete(&self, pks: Vec<String>) -> Result<WriteSummary>

Source

pub async fn delete_by_filter(&self, filter: impl Into<String>) -> Result<()>

Source

pub async fn insert_iter<I>( &self, docs: I, batch_size: usize, ) -> Result<WriteSummary>
where I: IntoIterator<Item = Doc> + Send + 'static,

Streamed batched insert. The input iterator must be Send + 'static; callers producing docs lazily from a channel or stream can .collect::<Vec<_>>().await upstream.

Source

pub async fn upsert_iter<I>( &self, docs: I, batch_size: usize, ) -> Result<WriteSummary>
where I: IntoIterator<Item = Doc> + Send + 'static,

Source

pub async fn update_iter<I>( &self, docs: I, batch_size: usize, ) -> Result<WriteSummary>
where I: IntoIterator<Item = Doc> + Send + 'static,

Source

pub async fn query(&self, query: VectorQuery) -> Result<DocSet>

Source

pub async fn fetch(&self, pks: Vec<String>) -> Result<DocSet>

Trait Implementations§

Source§

impl Clone for AsyncCollection

Source§

fn clone(&self) -> AsyncCollection

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more

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> 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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. 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.