pub struct QdrantPool { /* private fields */ }Expand description
Connection pool for Qdrant gRPC driver.
Uses a semaphore to limit concurrent connections. Each connection is independent and can be used concurrently.
§Example
ⓘ
use qail_qdrant::{QdrantPool, PoolConfig};
let pool = QdrantPool::new(
PoolConfig::new("localhost", 6334).max_connections(20)
).await?;
// Get a connection from the pool
let mut conn = pool.get().await?;
let results = conn.search("products", &embedding, 10, None).await?;Implementations§
Source§impl QdrantPool
impl QdrantPool
Sourcepub async fn new(config: PoolConfig) -> QdrantResult<Self>
pub async fn new(config: PoolConfig) -> QdrantResult<Self>
Create a new connection pool.
Sourcepub async fn get(&self) -> QdrantResult<PooledConnection>
pub async fn get(&self) -> QdrantResult<PooledConnection>
Get a connection from the pool.
This acquires a permit from the semaphore, limiting concurrency. The connection is created lazily when acquired.
Sourcepub fn max_connections(&self) -> usize
pub fn max_connections(&self) -> usize
Maximum number of connections.
Trait Implementations§
Source§impl Clone for QdrantPool
impl Clone for QdrantPool
Source§fn clone(&self) -> QdrantPool
fn clone(&self) -> QdrantPool
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 QdrantPool
impl !RefUnwindSafe for QdrantPool
impl Send for QdrantPool
impl Sync for QdrantPool
impl Unpin for QdrantPool
impl !UnwindSafe for QdrantPool
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