pub struct ConnectionPool { /* private fields */ }
Expand description
A connection pool
Implementations§
Source§impl ConnectionPool
impl ConnectionPool
pub fn new(endpoint: Endpoint, alpn: &[u8], options: Options) -> Self
Sourcepub async fn get_or_connect(
&self,
id: NodeId,
) -> Result<ConnectionRef, PoolConnectError>
pub async fn get_or_connect( &self, id: NodeId, ) -> Result<ConnectionRef, PoolConnectError>
Returns either a fresh connection or a reference to an existing one.
This is guaranteed to return after approximately Options::connect_timeout with either an error or a connection.
Trait Implementations§
Source§impl Clone for ConnectionPool
impl Clone for ConnectionPool
Source§fn clone(&self) -> ConnectionPool
fn clone(&self) -> ConnectionPool
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 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