pub struct ConnectionPool { /* private fields */ }Expand description
Connection pool for managing QUIC connections
Implementations§
Source§impl ConnectionPool
impl ConnectionPool
Sourcepub fn new(host: impl Into<String>, port: u16, max_size: usize) -> Self
pub fn new(host: impl Into<String>, port: u16, max_size: usize) -> Self
Create a new connection pool.
§Panics
Panics if max_size is 0. A connection pool must have at least one
connection slot to function properly. (Gap #18: CWE-400, CWE-835)
Sourcepub fn skip_verify(self, skip: bool) -> Self
pub fn skip_verify(self, skip: bool) -> Self
Configure to skip TLS verification
Sourcepub async fn acquire(&self) -> Result<PooledConnection>
pub async fn acquire(&self) -> Result<PooledConnection>
Acquire a connection from the pool
Returns a healthy connection from the pool, or creates a new one if needed. Stale connections (those where the underlying QUIC connection has been closed) are automatically discarded during acquisition.
Auto Trait Implementations§
impl Freeze for ConnectionPool
impl !RefUnwindSafe for ConnectionPool
impl Send for ConnectionPool
impl Sync for ConnectionPool
impl Unpin for ConnectionPool
impl !UnwindSafe for ConnectionPool
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request