pub struct SimplePool { /* private fields */ }Expand description
Mutex-protected free list of chunk buffers.
Finished messages are split() off the front of a chunk, so consecutive
messages pack into the same allocation (bump-arena style). take only
asks for a fresh chunk when less than a quarter of one is left; that
reserve reuses the allocation for free once every message cut from it
has been dropped, so steady state is zero allocations, and with messages
in flight it costs about one allocation per chunk instead of per message.
Memory pinned by in-flight messages is roughly their own size plus one chunk.
Implementations§
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for SimplePool
impl RefUnwindSafe for SimplePool
impl Send for SimplePool
impl Sync for SimplePool
impl Unpin for SimplePool
impl UnwindSafe for SimplePool
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