pub struct MemoryPool { /* private fields */ }Expand description
A memory pool for managing chunk allocations.
Implementations§
Source§impl MemoryPool
impl MemoryPool
Sourcepub fn new(chunk_size: usize, max_chunks: usize) -> Self
pub fn new(chunk_size: usize, max_chunks: usize) -> Self
Creates a new MemoryPool.
§Arguments
chunk_size- Size of each chunk in bytes (minimum 64)max_chunks- Maximum number of chunks (minimum 1)
Sourcepub fn chunk_size(&self) -> usize
pub fn chunk_size(&self) -> usize
Returns the chunk size.
Sourcepub fn max_chunks(&self) -> usize
pub fn max_chunks(&self) -> usize
Returns the maximum number of chunks.
Trait Implementations§
Source§impl Debug for MemoryPool
impl Debug for MemoryPool
Auto Trait Implementations§
impl Freeze for MemoryPool
impl RefUnwindSafe for MemoryPool
impl Send for MemoryPool
impl Sync for MemoryPool
impl Unpin for MemoryPool
impl UnsafeUnpin for MemoryPool
impl UnwindSafe for MemoryPool
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