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
impl AsyncCollection
Sourcepub async fn create_and_open(
path: impl Into<String>,
schema: CollectionSchema,
options: Option<CollectionOptions>,
) -> Result<Self>
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.
Sourcepub async fn open(
path: impl Into<String>,
options: Option<CollectionOptions>,
) -> Result<Self>
pub async fn open( path: impl Into<String>, options: Option<CollectionOptions>, ) -> Result<Self>
Open an existing collection at path.
Sourcepub fn from_arc(inner: Arc<Collection>) -> Self
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.
Sourcepub fn inner(&self) -> &Arc<Collection>
pub fn inner(&self) -> &Arc<Collection>
Access the underlying Arc<Collection>. Escape hatch for callers
that need APIs this wrapper doesn’t cover yet.
pub async fn flush(&self) -> Result<()>
pub async fn optimize(&self) -> Result<()>
pub async fn schema(&self) -> Result<CollectionSchema>
pub async fn options(&self) -> Result<CollectionOptions>
pub async fn stats(&self) -> Result<CollectionStats>
pub async fn create_index( &self, field_name: impl Into<String>, params: IndexParams, ) -> Result<()>
pub async fn drop_index(&self, field_name: impl Into<String>) -> Result<()>
pub async fn add_column( &self, field: FieldSchema, expression: Option<String>, ) -> Result<()>
pub async fn drop_column(&self, column_name: impl Into<String>) -> Result<()>
pub async fn alter_column( &self, column_name: impl Into<String>, new_name: Option<String>, new_schema: Option<FieldSchema>, ) -> Result<()>
pub async fn insert(&self, docs: Vec<Doc>) -> Result<WriteSummary>
pub async fn insert_with_results( &self, docs: Vec<Doc>, ) -> Result<Vec<WriteResult>>
pub async fn update(&self, docs: Vec<Doc>) -> Result<WriteSummary>
pub async fn update_with_results( &self, docs: Vec<Doc>, ) -> Result<Vec<WriteResult>>
pub async fn upsert(&self, docs: Vec<Doc>) -> Result<WriteSummary>
pub async fn upsert_with_results( &self, docs: Vec<Doc>, ) -> Result<Vec<WriteResult>>
pub async fn delete(&self, pks: Vec<String>) -> Result<WriteSummary>
pub async fn delete_by_filter(&self, filter: impl Into<String>) -> Result<()>
Sourcepub async fn insert_iter<I>(
&self,
docs: I,
batch_size: usize,
) -> Result<WriteSummary>
pub async fn insert_iter<I>( &self, docs: I, batch_size: usize, ) -> Result<WriteSummary>
Streamed batched insert. The input iterator must be Send + 'static;
callers producing docs lazily from a channel or stream can
.collect::<Vec<_>>().await upstream.
pub async fn upsert_iter<I>( &self, docs: I, batch_size: usize, ) -> Result<WriteSummary>
pub async fn update_iter<I>( &self, docs: I, batch_size: usize, ) -> Result<WriteSummary>
pub async fn query(&self, query: VectorQuery) -> Result<DocSet>
pub async fn fetch(&self, pks: Vec<String>) -> Result<DocSet>
Trait Implementations§
Source§impl Clone for AsyncCollection
impl Clone for AsyncCollection
Source§fn clone(&self) -> AsyncCollection
fn clone(&self) -> AsyncCollection
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 AsyncCollection
impl RefUnwindSafe for AsyncCollection
impl Send for AsyncCollection
impl Sync for AsyncCollection
impl Unpin for AsyncCollection
impl UnsafeUnpin for AsyncCollection
impl UnwindSafe for AsyncCollection
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