PooledGuard

Struct PooledGuard 

Source
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>

Source

pub fn to_owned(self) -> T

Clone the container and release the guard back to the pool

This returns a clone of the container while automatically releasing the original back to the pool for reuse.

Source

pub fn is_empty(&self) -> bool

Check if the container is still held by this guard

Source§

impl PooledGuard<BoolContainer>

Source

pub fn new_bool(pools: Pools, capacity: usize) -> Self

Create a new pooled BoolContainer with the specified capacity

Source§

impl PooledGuard<Utf8Container>

Source

pub fn new_string(pools: Pools, capacity: usize) -> Self

Create a new pooled StringContainer with the specified capacity

Source§

impl PooledGuard<BlobContainer>

Source

pub fn new_blob(pools: Pools, capacity: usize) -> Self

Create a new pooled BlobContainer with the specified capacity

Source§

impl PooledGuard<RowNumberContainer>

Source

pub fn new_row_number(pools: Pools, capacity: usize) -> Self

Create a new pooled RowNumberContainer with the specified capacity

Source§

impl PooledGuard<UndefinedContainer>

Source

pub fn new_undefined(pools: Pools, capacity: usize) -> Self

Create a new pooled UndefinedContainer with the specified capacity

Source§

impl PooledGuard<NumberContainer<i32>>

Source

pub fn new_i32(pools: Pools, capacity: usize) -> Self

Create a new pooled NumberContainer with the specified capacity

Source§

impl PooledGuard<NumberContainer<i64>>

Source

pub fn new_i64(pools: Pools, capacity: usize) -> Self

Create a new pooled NumberContainer with the specified capacity

Source§

impl PooledGuard<NumberContainer<f32>>

Source

pub fn new_f32(pools: Pools, capacity: usize) -> Self

Create a new pooled NumberContainer with the specified capacity

Source§

impl PooledGuard<NumberContainer<f64>>

Source

pub fn new_f64(pools: Pools, capacity: usize) -> Self

Create a new pooled NumberContainer with the specified capacity

Source§

impl PooledGuard<NumberContainer<i8>>

Source

pub fn new_i8(pools: Pools, capacity: usize) -> Self

Create a new pooled NumberContainer with the specified capacity

Source§

impl PooledGuard<NumberContainer<i16>>

Source

pub fn new_i16(pools: Pools, capacity: usize) -> Self

Create a new pooled NumberContainer with the specified capacity

Source§

impl PooledGuard<NumberContainer<i128>>

Source

pub fn new_i128(pools: Pools, capacity: usize) -> Self

Create a new pooled NumberContainer with the specified capacity

Source§

impl PooledGuard<NumberContainer<u8>>

Source

pub fn new_u8(pools: Pools, capacity: usize) -> Self

Create a new pooled NumberContainer with the specified capacity

Source§

impl PooledGuard<NumberContainer<u16>>

Source

pub fn new_u16(pools: Pools, capacity: usize) -> Self

Create a new pooled NumberContainer with the specified capacity

Source§

impl PooledGuard<NumberContainer<u32>>

Source

pub fn new_u32(pools: Pools, capacity: usize) -> Self

Create a new pooled NumberContainer with the specified capacity

Source§

impl PooledGuard<NumberContainer<u64>>

Source

pub fn new_u64(pools: Pools, capacity: usize) -> Self

Create a new pooled NumberContainer with the specified capacity

Source§

impl PooledGuard<NumberContainer<u128>>

Source

pub fn new_u128(pools: Pools, capacity: usize) -> Self

Create a new pooled NumberContainer with the specified capacity

Source§

impl PooledGuard<TemporalContainer<Date>>

Source

pub fn new_date(pools: Pools, capacity: usize) -> Self

Create a new pooled TemporalContainer with the specified capacity

Source§

impl PooledGuard<TemporalContainer<DateTime>>

Source

pub fn new_datetime(pools: Pools, capacity: usize) -> Self

Create a new pooled TemporalContainer with the specified capacity

Source§

impl PooledGuard<TemporalContainer<Time>>

Source

pub fn new_time(pools: Pools, capacity: usize) -> Self

Create a new pooled TemporalContainer

Source§

impl PooledGuard<TemporalContainer<Duration>>

Source

pub fn new_duration(pools: Pools, capacity: usize) -> Self

Create a new pooled TemporalContainer with the specified capacity

Source§

impl PooledGuard<UuidContainer<Uuid4>>

Source

pub fn new_uuid4(pools: Pools, capacity: usize) -> Self

Create a new pooled UuidContainer with the specified capacity

Source§

impl PooledGuard<UuidContainer<Uuid7>>

Source

pub fn new_uuid7(pools: Pools, capacity: usize) -> Self

Create a new pooled UuidContainer with the specified capacity

Trait Implementations§

Source§

impl<T: Releasable> Debug for PooledGuard<T>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<T: Releasable> Deref for PooledGuard<T>

Source§

type Target = T

The resulting type after dereferencing.
Source§

fn deref(&self) -> &Self::Target

Dereferences the value.
Source§

impl<T: Releasable> DerefMut for PooledGuard<T>

Source§

fn deref_mut(&mut self) -> &mut Self::Target

Mutably dereferences the value.
Source§

impl<T: Releasable> Drop for PooledGuard<T>

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more

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> !UnwindSafe for PooledGuard<T>

Blanket Implementations§

§

impl<T> Any for T
where T: 'static + ?Sized,

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Borrow<T> for T
where T: ?Sized,

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

impl<T> BorrowMut<T> for T
where T: ?Sized,

§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
§

impl<T, U> Into<U> for T
where U: From<T>,

§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<P, T> Receiver for P
where P: Deref<Target = T> + ?Sized, T: ?Sized,

§

type Target = T

🔬This is a nightly-only experimental API. (arbitrary_self_types)
The target type on which the method may be called.
§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more