pub struct Pool(/* private fields */);Expand description
Um pool de conexões ao Firebird. Clone livremente para compartilhar entre tarefas.
Implementations§
Source§impl Pool
impl Pool
Sourcepub fn new(config: ConnectConfig, pool_config: PoolConfig) -> Self
pub fn new(config: ConnectConfig, pool_config: PoolConfig) -> Self
Cria um pool vazio com a configuração fornecida. As conexões são criadas sob
demanda na primeira chamada a Self::get.
Sourcepub fn get(&self) -> Result<PooledConnection>
pub fn get(&self) -> Result<PooledConnection>
Obtém uma conexão do pool. Bloqueia (até o acquisition_timeout) se o
número máximo de conexões já estiver em uso.
Sempre que há uma conexão ociosa no pool, ela é reutilizada. Caso contrário, uma nova conexão é aberta. A conexão é devolvida ao pool ao cair fora de escopo.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Pool
impl RefUnwindSafe for Pool
impl Send for Pool
impl Sync for Pool
impl Unpin for Pool
impl UnsafeUnpin for Pool
impl UnwindSafe for Pool
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