pub struct ScopedPools { /* private fields */ }Expand description
RAII guard that sets thread-local pools and restores previous state on drop
Implementations§
Source§impl ScopedPools
impl ScopedPools
Sourcepub fn new(pools: Pools) -> Self
pub fn new(pools: Pools) -> Self
Create a new scoped pools guard Sets the given pools as thread-local and saves the previous state
Sourcepub fn with_config(config: PoolConfig) -> Self
pub fn with_config(config: PoolConfig) -> Self
Create a scoped guard with custom configuration
Sourcepub fn production() -> Self
pub fn production() -> Self
Create a scoped guard with production configuration
Sourcepub fn development() -> Self
pub fn development() -> Self
Create a scoped guard with development configuration
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ScopedPools
impl RefUnwindSafe for ScopedPools
impl !Send for ScopedPools
impl !Sync for ScopedPools
impl Unpin for ScopedPools
impl UnwindSafe for ScopedPools
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