pub struct ThreadSafeArena { /* private fields */ }Expand description
Thread-safe arena allocator wrapper
Implementations§
Source§impl ThreadSafeArena
impl ThreadSafeArena
pub fn new( base_ptr: NonNull<u8>, size: usize, config: ArenaConfig, ) -> Result<Self, ArenaError>
pub fn allocate(&self, size: usize) -> Result<NonNull<u8>, ArenaError>
pub fn reset(&self)
pub fn checkpoint(&self) -> Result<CheckpointHandle, ArenaError>
pub fn rollback(&self, handle: CheckpointHandle) -> Result<(), ArenaError>
pub fn get_usage(&self) -> ArenaUsage
pub fn get_stats(&self) -> ArenaStats
Auto Trait Implementations§
impl Freeze for ThreadSafeArena
impl RefUnwindSafe for ThreadSafeArena
impl Send for ThreadSafeArena
impl Sync for ThreadSafeArena
impl Unpin for ThreadSafeArena
impl UnwindSafe for ThreadSafeArena
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