pub struct SyncCollectionsApi { /* private fields */ }Expand description
Blocking wrapper for CollectionsApi.
Implementations§
Source§impl SyncCollectionsApi
impl SyncCollectionsApi
Sourcepub fn create(&self, request: CreateCollectionRequest) -> Result<Collection>
pub fn create(&self, request: CreateCollectionRequest) -> Result<Collection>
Create a collection from a request object.
Sourcepub fn create_named(&self, name: impl Into<String>) -> Result<Collection>
pub fn create_named(&self, name: impl Into<String>) -> Result<Collection>
Create a collection with only a name.
Sourcepub fn get(&self, collection_id: impl AsRef<str>) -> Result<Collection>
pub fn get(&self, collection_id: impl AsRef<str>) -> Result<Collection>
Get a collection by ID.
Sourcepub fn list(&self) -> Result<CollectionListResponse>
pub fn list(&self) -> Result<CollectionListResponse>
List collections.
Sourcepub fn list_with_options(
&self,
limit: Option<u32>,
next_token: Option<&str>,
) -> Result<CollectionListResponse>
pub fn list_with_options( &self, limit: Option<u32>, next_token: Option<&str>, ) -> Result<CollectionListResponse>
List collections with pagination options.
Sourcepub fn add_documents(
&self,
collection_id: impl AsRef<str>,
documents: Vec<Document>,
) -> Result<AddDocumentsResponse>
pub fn add_documents( &self, collection_id: impl AsRef<str>, documents: Vec<Document>, ) -> Result<AddDocumentsResponse>
Add documents to a collection.
Sourcepub fn add_document(
&self,
collection_id: impl AsRef<str>,
document: Document,
) -> Result<String>
pub fn add_document( &self, collection_id: impl AsRef<str>, document: Document, ) -> Result<String>
Add a single document to a collection.
Sourcepub fn update(
&self,
collection_id: impl AsRef<str>,
request: UpdateCollectionRequest,
) -> Result<Collection>
pub fn update( &self, collection_id: impl AsRef<str>, request: UpdateCollectionRequest, ) -> Result<Collection>
Update a collection.
Sourcepub fn upsert_document(
&self,
collection_id: impl AsRef<str>,
document: Document,
) -> Result<Document>
pub fn upsert_document( &self, collection_id: impl AsRef<str>, document: Document, ) -> Result<Document>
Add or replace a document by ID.
Sourcepub fn batch_get_documents(
&self,
collection_id: impl AsRef<str>,
request: BatchGetDocumentsRequest,
) -> Result<DocumentListResponse>
pub fn batch_get_documents( &self, collection_id: impl AsRef<str>, request: BatchGetDocumentsRequest, ) -> Result<DocumentListResponse>
Get multiple documents by IDs.
Sourcepub fn list_documents(
&self,
collection_id: impl AsRef<str>,
) -> Result<DocumentListResponse>
pub fn list_documents( &self, collection_id: impl AsRef<str>, ) -> Result<DocumentListResponse>
List documents in a collection.
Sourcepub fn list_documents_with_options(
&self,
collection_id: impl AsRef<str>,
limit: Option<u32>,
next_token: Option<&str>,
) -> Result<DocumentListResponse>
pub fn list_documents_with_options( &self, collection_id: impl AsRef<str>, limit: Option<u32>, next_token: Option<&str>, ) -> Result<DocumentListResponse>
List documents in a collection with pagination options.
Sourcepub fn get_document(
&self,
collection_id: impl AsRef<str>,
document_id: impl AsRef<str>,
) -> Result<Document>
pub fn get_document( &self, collection_id: impl AsRef<str>, document_id: impl AsRef<str>, ) -> Result<Document>
Get a document by ID.
Sourcepub fn delete_document(
&self,
collection_id: impl AsRef<str>,
document_id: impl AsRef<str>,
) -> Result<()>
pub fn delete_document( &self, collection_id: impl AsRef<str>, document_id: impl AsRef<str>, ) -> Result<()>
Delete a document from a collection.
Sourcepub fn search(
&self,
collection_id: impl AsRef<str>,
request: SearchRequest,
) -> Result<SearchResponse>
pub fn search( &self, collection_id: impl AsRef<str>, request: SearchRequest, ) -> Result<SearchResponse>
Search a collection with a request object.
Sourcepub fn search_query(
&self,
collection_id: impl AsRef<str>,
query: impl Into<String>,
) -> Result<SearchResponse>
pub fn search_query( &self, collection_id: impl AsRef<str>, query: impl Into<String>, ) -> Result<SearchResponse>
Search a collection with a query string.
Trait Implementations§
Source§impl Clone for SyncCollectionsApi
impl Clone for SyncCollectionsApi
Source§fn clone(&self) -> SyncCollectionsApi
fn clone(&self) -> SyncCollectionsApi
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 SyncCollectionsApi
impl !RefUnwindSafe for SyncCollectionsApi
impl Send for SyncCollectionsApi
impl Sync for SyncCollectionsApi
impl Unpin for SyncCollectionsApi
impl UnsafeUnpin for SyncCollectionsApi
impl !UnwindSafe for SyncCollectionsApi
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