pub struct ArenaStr { /* private fields */ }Expand description
An arena-based string allocator that stores strings in contiguous memory.
Implementations§
Source§impl ArenaStr
impl ArenaStr
pub fn new() -> Self
pub fn with_capacity(capacity: usize) -> Self
pub fn alloc(&mut self, s: &str) -> usize
pub fn get(&self, id: usize) -> Option<&str>
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
pub fn total_bytes(&self) -> usize
pub fn clear(&mut self)
pub fn contains(&self, s: &str) -> bool
pub fn avg_len(&self) -> f32
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ArenaStr
impl RefUnwindSafe for ArenaStr
impl Send for ArenaStr
impl Sync for ArenaStr
impl Unpin for ArenaStr
impl UnsafeUnpin for ArenaStr
impl UnwindSafe for ArenaStr
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