pub struct VectorDBClient { /* private fields */ }
Implementations§
Source§impl VectorDBClient
impl VectorDBClient
Sourcepub fn new(
url: impl AsRef<str>,
username: impl Into<String>,
key: impl Into<String>,
read_consistency: ReadConsistency,
timeout_secs: u64,
) -> Result<Self>
pub fn new( url: impl AsRef<str>, username: impl Into<String>, key: impl Into<String>, read_consistency: ReadConsistency, timeout_secs: u64, ) -> Result<Self>
Create a new VectorDB client
Sourcepub fn with_client(
client: Client,
url: impl AsRef<str>,
username: impl Into<String>,
key: impl Into<String>,
read_consistency: ReadConsistency,
) -> Result<Self>
pub fn with_client( client: Client, url: impl AsRef<str>, username: impl Into<String>, key: impl Into<String>, read_consistency: ReadConsistency, ) -> Result<Self>
Create a new VectorDB client with custom reqwest client
Sourcepub fn http_client(&self) -> &Client
pub fn http_client(&self) -> &Client
Get the HTTP client
Sourcepub fn read_consistency(&self) -> &ReadConsistency
pub fn read_consistency(&self) -> &ReadConsistency
Get the read consistency setting
Sourcepub async fn exists_database(&self, database_name: &str) -> Result<bool>
pub async fn exists_database(&self, database_name: &str) -> Result<bool>
Check if a database exists
Sourcepub async fn create_database(
&self,
database_name: impl Into<String>,
) -> Result<Database>
pub async fn create_database( &self, database_name: impl Into<String>, ) -> Result<Database>
Create a new database
Sourcepub async fn create_database_if_not_exists(
&self,
database_name: impl Into<String>,
) -> Result<Database>
pub async fn create_database_if_not_exists( &self, database_name: impl Into<String>, ) -> Result<Database>
Create a database if it doesn’t exist
Sourcepub async fn drop_database(
&self,
database_name: impl Into<String>,
) -> Result<Value>
pub async fn drop_database( &self, database_name: impl Into<String>, ) -> Result<Value>
Drop a database
Sourcepub async fn list_databases(&self) -> Result<Vec<Database>>
pub async fn list_databases(&self) -> Result<Vec<Database>>
List all databases
Trait Implementations§
Source§impl Clone for VectorDBClient
impl Clone for VectorDBClient
Source§fn clone(&self) -> VectorDBClient
fn clone(&self) -> VectorDBClient
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 VectorDBClient
impl !RefUnwindSafe for VectorDBClient
impl Send for VectorDBClient
impl Sync for VectorDBClient
impl Unpin for VectorDBClient
impl !UnwindSafe for VectorDBClient
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