pub struct SafeMemoryPool<T> { /* private fields */ }Expand description
Safe memory pool for efficient allocation with automatic cleanup
Implementations§
Source§impl<T> SafeMemoryPool<T>
impl<T> SafeMemoryPool<T>
Sourcepub fn new() -> SafeMemoryPool<T>
pub fn new() -> SafeMemoryPool<T>
Create a new safe memory pool
Sourcepub fn with_limits(max_pool_size: usize) -> SafeMemoryPool<T>
pub fn with_limits(max_pool_size: usize) -> SafeMemoryPool<T>
Create a new safe memory pool with custom limits
Sourcepub fn allocate(&self, capacity: usize) -> SafePooledBuffer<T>
pub fn allocate(&self, capacity: usize) -> SafePooledBuffer<T>
Allocate a vector with the specified capacity
Sourcepub fn stats(&self) -> MemoryPoolStats
pub fn stats(&self) -> MemoryPoolStats
Get current allocation statistics
Trait Implementations§
Source§impl<T> Default for SafeMemoryPool<T>
impl<T> Default for SafeMemoryPool<T>
Source§fn default() -> SafeMemoryPool<T>
fn default() -> SafeMemoryPool<T>
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl<T> Freeze for SafeMemoryPool<T>
impl<T> RefUnwindSafe for SafeMemoryPool<T>
impl<T> Send for SafeMemoryPool<T>where
T: Send,
impl<T> Sync for SafeMemoryPool<T>where
T: Send,
impl<T> Unpin for SafeMemoryPool<T>
impl<T> UnwindSafe for SafeMemoryPool<T>
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
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 more