pub struct PoolBuilder { /* private fields */ }Expand description
builder type for connection pool
Implementations§
Source§impl PoolBuilder
impl PoolBuilder
Sourcepub fn capacity(self, cap: usize) -> Self
pub fn capacity(self, cap: usize) -> Self
set capacity. pool would spawn up to amount of capacity concurrent connections to database.
§Default
capacity default to 1
Sourcepub fn cache_size(self, size: usize) -> Self
pub fn cache_size(self, size: usize) -> Self
set statment cache size. every connection in pool would keep a set of prepared statement cache to speed up repeated query
§Default
cache_size default to 16
Auto Trait Implementations§
impl Freeze for PoolBuilder
impl !RefUnwindSafe for PoolBuilder
impl Send for PoolBuilder
impl Sync for PoolBuilder
impl Unpin for PoolBuilder
impl UnsafeUnpin for PoolBuilder
impl !UnwindSafe for PoolBuilder
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