pub struct PooledGuard<T: Releasable> { /* private fields */ }Expand description
A guard that automatically returns a container to its pool when dropped
This implements the RAII pattern for container pooling - when the guard goes out of scope, it automatically releases the contained value back to the pool for reuse.
Implementations§
Source§impl<T: Releasable> PooledGuard<T>
impl<T: Releasable> PooledGuard<T>
Source§impl PooledGuard<Utf8Container>
impl PooledGuard<Utf8Container>
Sourcepub fn new_string(pools: Pools, capacity: usize) -> Self
pub fn new_string(pools: Pools, capacity: usize) -> Self
Create a new pooled StringContainer with the specified capacity
Source§impl PooledGuard<RowNumberContainer>
impl PooledGuard<RowNumberContainer>
Sourcepub fn new_row_number(pools: Pools, capacity: usize) -> Self
pub fn new_row_number(pools: Pools, capacity: usize) -> Self
Create a new pooled RowNumberContainer with the specified capacity
Source§impl PooledGuard<NumberContainer<i32>>
impl PooledGuard<NumberContainer<i32>>
Source§impl PooledGuard<NumberContainer<i64>>
impl PooledGuard<NumberContainer<i64>>
Source§impl PooledGuard<NumberContainer<f32>>
impl PooledGuard<NumberContainer<f32>>
Source§impl PooledGuard<NumberContainer<f64>>
impl PooledGuard<NumberContainer<f64>>
Source§impl PooledGuard<NumberContainer<i8>>
impl PooledGuard<NumberContainer<i8>>
Source§impl PooledGuard<NumberContainer<i16>>
impl PooledGuard<NumberContainer<i16>>
Source§impl PooledGuard<NumberContainer<u8>>
impl PooledGuard<NumberContainer<u8>>
Source§impl PooledGuard<NumberContainer<u16>>
impl PooledGuard<NumberContainer<u16>>
Source§impl PooledGuard<NumberContainer<u32>>
impl PooledGuard<NumberContainer<u32>>
Source§impl PooledGuard<NumberContainer<u64>>
impl PooledGuard<NumberContainer<u64>>
Source§impl PooledGuard<TemporalContainer<DateTime>>
impl PooledGuard<TemporalContainer<DateTime>>
Sourcepub fn new_datetime(pools: Pools, capacity: usize) -> Self
pub fn new_datetime(pools: Pools, capacity: usize) -> Self
Create a new pooled TemporalContainer
Source§impl PooledGuard<TemporalContainer<Duration>>
impl PooledGuard<TemporalContainer<Duration>>
Sourcepub fn new_duration(pools: Pools, capacity: usize) -> Self
pub fn new_duration(pools: Pools, capacity: usize) -> Self
Create a new pooled TemporalContainer
Source§impl PooledGuard<UuidContainer<Uuid4>>
impl PooledGuard<UuidContainer<Uuid4>>
Source§impl PooledGuard<UuidContainer<Uuid7>>
impl PooledGuard<UuidContainer<Uuid7>>
Trait Implementations§
Source§impl<T: Releasable> Debug for PooledGuard<T>
impl<T: Releasable> Debug for PooledGuard<T>
Source§impl<T: Releasable> Deref for PooledGuard<T>
impl<T: Releasable> Deref for PooledGuard<T>
Source§impl<T: Releasable> DerefMut for PooledGuard<T>
impl<T: Releasable> DerefMut for PooledGuard<T>
Source§impl<T: Releasable> Drop for PooledGuard<T>
impl<T: Releasable> Drop for PooledGuard<T>
Auto Trait Implementations§
impl<T> Freeze for PooledGuard<T>where
T: Freeze,
impl<T> !RefUnwindSafe for PooledGuard<T>
impl<T> !Send for PooledGuard<T>
impl<T> !Sync for PooledGuard<T>
impl<T> Unpin for PooledGuard<T>where
T: Unpin,
impl<T> UnsafeUnpin for PooledGuard<T>where
T: UnsafeUnpin,
impl<T> !UnwindSafe for PooledGuard<T>
Blanket Implementations§
Source§impl<R> TryRngCore for Rwhere
R: TryRng,
impl<R> TryRngCore for Rwhere
R: TryRng,
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<R> RngExt for R
impl<R> RngExt for R
Source§fn random<T>(&mut self) -> Twhere
StandardUniform: Distribution<T>,
fn random<T>(&mut self) -> Twhere
StandardUniform: Distribution<T>,
Return a random value via the
StandardUniform distribution. Read moreSource§fn random_iter<T>(self) -> Iter<StandardUniform, Self, T>
fn random_iter<T>(self) -> Iter<StandardUniform, Self, T>
Source§fn random_range<T, R>(&mut self, range: R) -> Twhere
T: SampleUniform,
R: SampleRange<T>,
fn random_range<T, R>(&mut self, range: R) -> Twhere
T: SampleUniform,
R: SampleRange<T>,
Generate a random value in the given range. Read more
Source§fn random_bool(&mut self, p: f64) -> bool
fn random_bool(&mut self, p: f64) -> bool
Return a bool with a probability
p of being true. Read moreSource§fn random_ratio(&mut self, numerator: u32, denominator: u32) -> bool
fn random_ratio(&mut self, numerator: u32, denominator: u32) -> bool
Return a bool with a probability of
numerator/denominator of being
true. Read moreSource§fn sample<T, D>(&mut self, distr: D) -> Twhere
D: Distribution<T>,
fn sample<T, D>(&mut self, distr: D) -> Twhere
D: Distribution<T>,
Sample a new value, using the given distribution. Read more
Source§fn sample_iter<T, D>(self, distr: D) -> Iter<D, Self, T>where
D: Distribution<T>,
Self: Sized,
fn sample_iter<T, D>(self, distr: D) -> Iter<D, Self, T>where
D: Distribution<T>,
Self: Sized,
Create an iterator that generates values using the given distribution. Read more