Struct chromadb::v1::client::ChromaClient
source · pub struct ChromaClient { /* private fields */ }
Implementations§
source§impl ChromaClient
impl ChromaClient
sourcepub fn new(_: ChromaClientOptions) -> ChromaClient
pub fn new(_: ChromaClientOptions) -> ChromaClient
Create a new Chroma client with the given options.
- Defaults to
url
: http://localhost:8000
sourcepub fn create_collection(
&self,
name: &str,
metadata: Option<Map<String, Value>>,
get_or_create: bool
) -> Result<ChromaCollection>
pub fn create_collection( &self, name: &str, metadata: Option<Map<String, Value>>, get_or_create: bool ) -> Result<ChromaCollection>
Create a new collection with the given name and metadata.
§Arguments
name
- The name of the collection to createmetadata
- Optional metadata to associate with the collection. Must be a JSON object with keys and values that are either numbers, strings or floats.get_or_create
- If true, return the existing collection if it exists
§Errors
- If the collection already exists and get_or_create is false
- If the collection name is invalid
sourcepub fn get_or_create_collection(
&self,
name: &str,
metadata: Option<Map<String, Value>>
) -> Result<ChromaCollection>
pub fn get_or_create_collection( &self, name: &str, metadata: Option<Map<String, Value>> ) -> Result<ChromaCollection>
Get or create a collection with the given name and metadata.
§Arguments
name
- The name of the collection to get or createmetadata
- Optional metadata to associate with the collection. Must be a JSON object with keys and values that are either numbers, strings or floats.
§Errors
- If the collection name is invalid
sourcepub fn list_collections(&self) -> Result<Vec<ChromaCollection>>
pub fn list_collections(&self) -> Result<Vec<ChromaCollection>>
List all collections
sourcepub fn get_collection(&self, name: &str) -> Result<ChromaCollection>
pub fn get_collection(&self, name: &str) -> Result<ChromaCollection>
sourcepub fn delete_collection(&self, name: &str) -> Result<()>
pub fn delete_collection(&self, name: &str) -> Result<()>
Auto Trait Implementations§
impl Freeze for ChromaClient
impl RefUnwindSafe for ChromaClient
impl Send for ChromaClient
impl Sync for ChromaClient
impl Unpin for ChromaClient
impl UnwindSafe for ChromaClient
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