pub struct BufferPool { /* private fields */ }Expand description
Buffer pool for deterministic memory allocation
Pre-allocates memory to avoid runtime allocation failures in embedded systems (Toyota Way: Heijunka).
Implementations§
Source§impl BufferPool
impl BufferPool
Sourcepub fn new(buffer_count: usize, buffer_size: usize) -> BufferPool
pub fn new(buffer_count: usize, buffer_size: usize) -> BufferPool
Create a new buffer pool
Sourcepub const fn buffer_size(&self) -> usize
pub const fn buffer_size(&self) -> usize
Get the buffer size
Sourcepub const fn free_count(&self) -> usize
pub const fn free_count(&self) -> usize
Get number of free buffers
Sourcepub fn total_count(&self) -> usize
pub fn total_count(&self) -> usize
Get total buffer count
Sourcepub fn total_memory(&self) -> usize
pub fn total_memory(&self) -> usize
Get total memory usage
Trait Implementations§
Auto Trait Implementations§
impl Freeze for BufferPool
impl RefUnwindSafe for BufferPool
impl Send for BufferPool
impl Sync for BufferPool
impl Unpin for BufferPool
impl UnsafeUnpin for BufferPool
impl UnwindSafe for BufferPool
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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