pub struct IoArena { /* private fields */ }Expand description
Arena used by the IO thread.
Not thread-safe by design. One arena per socket actor.
Implementations§
Source§impl IoArena
impl IoArena
pub const fn new() -> Self
Sourcepub fn alloc_mut(&mut self, size: usize) -> SlabMut
pub fn alloc_mut(&mut self, size: usize) -> SlabMut
Allocate a mutable buffer suitable for a single IO read.
For size <= PAGE_SIZE multiple allocations share the same slab page
(bump-pointer, zero-overhead). For size > PAGE_SIZE a dedicated page
of exactly size bytes is allocated; subsequent small allocations start
a fresh normal page. No artificial ceiling on size.
This guarantees:
- Stable memory address
- No reallocation
- No aliasing with other
SlabMut
Trait Implementations§
Auto Trait Implementations§
impl Freeze for IoArena
impl RefUnwindSafe for IoArena
impl Send for IoArena
impl Sync for IoArena
impl Unpin for IoArena
impl UnsafeUnpin for IoArena
impl UnwindSafe for IoArena
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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