pub struct ConnectionPool { /* private fields */ }Expand description
Bitcoin RPC connection pool
Implementations§
Source§impl ConnectionPool
impl ConnectionPool
Sourcepub async fn new(
url: &str,
user: &str,
password: &str,
network: BitcoinNetwork,
) -> Result<Self>
pub async fn new( url: &str, user: &str, password: &str, network: BitcoinNetwork, ) -> Result<Self>
Create a new connection pool
Sourcepub async fn with_config(
url: &str,
user: &str,
password: &str,
network: BitcoinNetwork,
config: PoolConfig,
) -> Result<Self>
pub async fn with_config( url: &str, user: &str, password: &str, network: BitcoinNetwork, config: PoolConfig, ) -> Result<Self>
Create a new connection pool with custom configuration
Sourcepub async fn get_connection(&self) -> Result<PooledConnectionGuard>
pub async fn get_connection(&self) -> Result<PooledConnectionGuard>
Get a connection from the pool
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