ArenaAllocator

Trait ArenaAllocator 

Source
pub trait ArenaAllocator: Allocator {
    // Provided method
    fn allocate(&self, str: &str) -> Result<&str, AllocError> { ... }
}
Expand description

A trait that indicates an allocator is arena allocator, meaning it doesn’t deallocate individual items, but deallocates their memory as a group when the arena is dropped.

Provided Methods§

Source

fn allocate(&self, str: &str) -> Result<&str, AllocError>

Copies the str into the arena, and returns a slice to the new str.

Implementations on Foreign Types§

Source§

impl<A: Allocator + Clone> ArenaAllocator for ChainAllocator<A>

Implementors§