pub struct BatchArena { /* private fields */ }Expand description
Arena allocator optimized for batch cryptographic operations.
Provides fast bump allocation for temporary data structures used during batch verification, serialization, and merkle tree building.
Implementations§
Source§impl BatchArena
impl BatchArena
Sourcepub fn with_capacity(capacity: usize) -> Self
pub fn with_capacity(capacity: usize) -> Self
Create a new arena with specified capacity.
Sourcepub fn for_events(count: usize) -> Self
pub fn for_events(count: usize) -> Self
Create arena sized for a batch of events.
Estimates ~1KB per event for canonical bytes + metadata.
Sourcepub fn for_hashes(count: usize) -> Self
pub fn for_hashes(count: usize) -> Self
Create arena sized for batch hash operations.
Estimates 32 bytes per hash + overhead.
Sourcepub fn alloc_bytes(&self, bytes: &[u8]) -> &[u8] ⓘ
pub fn alloc_bytes(&self, bytes: &[u8]) -> &[u8] ⓘ
Allocate a slice of bytes in the arena.
Sourcepub fn alloc_slice<T: Copy>(&self, slice: &[T]) -> &[T]
pub fn alloc_slice<T: Copy>(&self, slice: &[T]) -> &[T]
Allocate a slice in the arena.
Sourcepub fn alloc_vec_with_capacity<T>(&self, capacity: usize) -> BumpVec<'_, T>
pub fn alloc_vec_with_capacity<T>(&self, capacity: usize) -> BumpVec<'_, T>
Create a vector with capacity in the arena.
Sourcepub fn alloc_slice_fill_default<T: Default + Clone>(
&self,
count: usize,
) -> &mut [T]
pub fn alloc_slice_fill_default<T: Default + Clone>( &self, count: usize, ) -> &mut [T]
Allocate space for N items and return a slice.
Sourcepub fn alloc_hash_array(&self, count: usize) -> &mut [Hash]
pub fn alloc_hash_array(&self, count: usize) -> &mut [Hash]
Allocate a hash array in the arena.
Sourcepub fn allocated_bytes(&self) -> usize
pub fn allocated_bytes(&self) -> usize
Get the number of bytes allocated.
Trait Implementations§
Source§impl Debug for BatchArena
impl Debug for BatchArena
Auto Trait Implementations§
impl !Freeze for BatchArena
impl !RefUnwindSafe for BatchArena
impl Send for BatchArena
impl !Sync for BatchArena
impl Unpin for BatchArena
impl !UnwindSafe for BatchArena
Blanket Implementations§
Source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
Source§type ArchivedMetadata = ()
type ArchivedMetadata = ()
The archived version of the pointer metadata for this type.
Source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
Converts some archived metadata to the pointer metadata for itself.
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 moreSource§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
Source§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Returns the layout of the type.
Source§impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
Source§unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
Returns whether the given value has been niched. Read more
Source§fn resolve_niched(out: Place<NichedOption<T, N1>>)
fn resolve_niched(out: Place<NichedOption<T, N1>>)
Writes data to
out indicating that a T is niched.