pub struct ArenaSlice<T> { /* private fields */ }Expand description
Interning arena for slices of type T.
Implementations§
Source§impl<T> ArenaSlice<T>
impl<T> ArenaSlice<T>
Sourcepub fn with_capacity(slices: usize, items: usize) -> Self
Available on crate feature raw only.
pub fn with_capacity(slices: usize, items: usize) -> Self
raw only.Creates a new arena with pre-allocated space to store at least the given
number of slices, totalling the given number of items of type T.
Sourcepub fn slices(&self) -> usize
Available on crate feature raw only.
pub fn slices(&self) -> usize
raw only.Returns the number of slices in this arena.
Note that because ArenaSlice is a concurrent data structure, this is
only a snapshot as viewed by this thread, and the result may change
if other threads are inserting values.
Sourcepub fn items(&self) -> usize
Available on crate feature raw only.
pub fn items(&self) -> usize
raw only.Returns the total number of items of type T in this arena.
Note that because ArenaSlice is a concurrent data structure, this is
only a snapshot as viewed by this thread, and the result may change
if other threads are inserting values.
Sourcepub fn is_empty(&self) -> bool
Available on crate feature raw only.
pub fn is_empty(&self) -> bool
raw only.Checks if this arena is empty.
Note that because ArenaSlice is a concurrent data structure, this is
only a snapshot as viewed by this thread, and the result may change
if other threads are inserting values.
Source§impl<T> ArenaSlice<T>
impl<T> ArenaSlice<T>
Source§impl<T> ArenaSlice<T>where
T: GetSize,
impl<T> ArenaSlice<T>where
T: GetSize,
Sourcepub fn print_summary(&self, prefix: &str, title: &str, total_bytes: usize)
Available on crate feature debug only.
pub fn print_summary(&self, prefix: &str, title: &str, total_bytes: usize)
debug only.Prints a summary of the storage used by this arena to stdout.
Trait Implementations§
Source§impl<T> Debug for ArenaSlice<T>where
T: Debug,
impl<T> Debug for ArenaSlice<T>where
T: Debug,
Source§impl<T> Default for ArenaSlice<T>
impl<T> Default for ArenaSlice<T>
Source§impl<'de, T> Deserialize<'de> for ArenaSlice<T>
Available on crate feature serde only.
impl<'de, T> Deserialize<'de> for ArenaSlice<T>
serde only.Source§fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
Source§impl<T> GetSize for ArenaSlice<T>where
T: GetSize,
Available on crate feature get-size2 only.
impl<T> GetSize for ArenaSlice<T>where
T: GetSize,
get-size2 only.Source§fn get_heap_size_with_tracker<Tr: GetSizeTracker>(
&self,
tracker: Tr,
) -> (usize, Tr)
fn get_heap_size_with_tracker<Tr: GetSizeTracker>( &self, tracker: Tr, ) -> (usize, Tr)
tracker. Read moreSource§fn get_stack_size() -> usize
fn get_stack_size() -> usize
Source§fn get_heap_size(&self) -> usize
fn get_heap_size(&self) -> usize
Source§fn get_size_with_tracker<T>(&self, tracker: T) -> (usize, T)where
T: GetSizeTracker,
fn get_size_with_tracker<T>(&self, tracker: T) -> (usize, T)where
T: GetSizeTracker,
tracker. Read moreSource§impl<T> PartialEq for ArenaSlice<T>
impl<T> PartialEq for ArenaSlice<T>
Source§impl<T> Serialize for ArenaSlice<T>where
T: Serialize,
Available on crate feature serde only.
impl<T> Serialize for ArenaSlice<T>where
T: Serialize,
serde only.impl<T> Eq for ArenaSlice<T>
Auto Trait Implementations§
impl<T> !Freeze for ArenaSlice<T>
impl<T> !RefUnwindSafe for ArenaSlice<T>
impl<T> Send for ArenaSlice<T>
impl<T> Sync for ArenaSlice<T>
impl<T> Unpin for ArenaSlice<T>
impl<T> UnwindSafe for ArenaSlice<T>where
T: RefUnwindSafe,
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
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.