pub enum BoxStorage {}Expand description
Storage that stores values in boxes.
§Memory Efficiency
Vastly more memory-efficient than inline storage: heaptrack suggests on the order of 5x
better.
Notably, size_of::<Box<T>>() is always a single usize, while an inline Node is 2
Array256es, which are comparatively large (256-bit bitset + vec -> ~7x larger up to alignment
on a 64-bit arch). Suspect the large overhead for inline storage is mostly due to the
powers-of-two oversizing of the Node::children Vec storage: this is going to be costly in
direct proportion to the size of the contained value.
Trait Implementations§
Source§impl Clone for BoxStorage
impl Clone for BoxStorage
Source§fn clone(&self) -> BoxStorage
fn clone(&self) -> BoxStorage
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for BoxStorage
Source§impl Debug for BoxStorage
impl Debug for BoxStorage
impl Eq for BoxStorage
Source§impl Hash for BoxStorage
impl Hash for BoxStorage
Source§impl Ord for BoxStorage
impl Ord for BoxStorage
Source§fn cmp(&self, other: &BoxStorage) -> Ordering
fn cmp(&self, other: &BoxStorage) -> Ordering
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq for BoxStorage
impl PartialEq for BoxStorage
Source§fn eq(&self, other: &BoxStorage) -> bool
fn eq(&self, other: &BoxStorage) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl PartialOrd for BoxStorage
impl PartialOrd for BoxStorage
Source§impl Storage for BoxStorage
impl Storage for BoxStorage
Source§fn into_inner<T>(container: Self::Container<T>) -> T
fn into_inner<T>(container: Self::Container<T>) -> T
Destruct the container to retrieve the contained value.
Source§fn as_ref<T>(container: &Self::Container<T>) -> &T
fn as_ref<T>(container: &Self::Container<T>) -> &T
Retrieve a reference to the contained value.
impl StructuralPartialEq for BoxStorage
Auto Trait Implementations§
impl Freeze for BoxStorage
impl RefUnwindSafe for BoxStorage
impl Send for BoxStorage
impl Sync for BoxStorage
impl Unpin for BoxStorage
impl UnsafeUnpin for BoxStorage
impl UnwindSafe for BoxStorage
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