pub struct ExpLinkedList<T> { /* private fields */ }
Expand description
A linked list that grows exponentially. It is used to store a large number of
elements in a memory-efficient way. The list grows by doubling the capacity of
the last element when it’s full, the capacity can be limited by the limit
parameter. The default value is 0, which means no limit.
Implementations§
Source§impl<T> ExpLinkedList<T>
impl<T> ExpLinkedList<T>
pub fn with_capacity(capacity: usize) -> Self
Sourcepub fn with_capacity_limit(self, limit: u16) -> Self
pub fn with_capacity_limit(self, limit: u16) -> Self
Creates a new ExpLinkedList
with a specified capacity limit.
The limit is the maximum capacity of a single node in the list.
If the limit is 0, there is no limit.
Sourcepub fn push(&mut self, v: T)
pub fn push(&mut self, v: T)
Pushes a new element into the list. If the last element in the list reaches its capacity, a new node is created with double capacity.
Sourcepub fn clear(&mut self)
pub fn clear(&mut self)
Clears the list, removing all elements. This will free the memory used by the list.
Sourcepub fn size(&self) -> usize
pub fn size(&self) -> usize
Returns the size of list, including the size of the elements and the
size of the list itself, and the unused space.
The element size is calculated using std::mem::size_of::<T>()
,
so it is not accurate for all types.
For example, for String
, it will return the size of the pointer,
not the size of the string itself. For that you need to use DeepSizeOf
.
Sourcepub fn iter(&self) -> ExpLinkedListIter<'_, T> ⓘ
pub fn iter(&self) -> ExpLinkedListIter<'_, T> ⓘ
Returns an iterator over the elements in the list.
pub fn block_iter(&self) -> impl Iterator<Item = &[T]>
Trait Implementations§
Source§impl<T: Clone> Clone for ExpLinkedList<T>
impl<T: Clone> Clone for ExpLinkedList<T>
Source§fn clone(&self) -> ExpLinkedList<T>
fn clone(&self) -> ExpLinkedList<T>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl<T: Debug> Debug for ExpLinkedList<T>
impl<T: Debug> Debug for ExpLinkedList<T>
Source§impl<T: DeepSizeOf> DeepSizeOf for ExpLinkedList<T>
impl<T: DeepSizeOf> DeepSizeOf for ExpLinkedList<T>
Source§fn deep_size_of_children(&self, context: &mut Context) -> usize
fn deep_size_of_children(&self, context: &mut Context) -> usize
Source§fn deep_size_of(&self) -> usize
fn deep_size_of(&self) -> usize
Source§impl<T: Default> Default for ExpLinkedList<T>
impl<T: Default> Default for ExpLinkedList<T>
Source§fn default() -> ExpLinkedList<T>
fn default() -> ExpLinkedList<T>
Source§impl<T> FromIterator<T> for ExpLinkedList<T>
impl<T> FromIterator<T> for ExpLinkedList<T>
Source§fn from_iter<I: IntoIterator<Item = T>>(iter: I) -> Self
fn from_iter<I: IntoIterator<Item = T>>(iter: I) -> Self
Source§impl<T> IntoIterator for ExpLinkedList<T>
impl<T> IntoIterator for ExpLinkedList<T>
Source§impl<T> PartialEq for ExpLinkedList<T>where
T: PartialEq,
impl<T> PartialEq for ExpLinkedList<T>where
T: PartialEq,
impl<T> Eq for ExpLinkedList<T>where
T: Eq,
Auto Trait Implementations§
impl<T> Freeze for ExpLinkedList<T>
impl<T> RefUnwindSafe for ExpLinkedList<T>where
T: RefUnwindSafe,
impl<T> Send for ExpLinkedList<T>where
T: Send,
impl<T> Sync for ExpLinkedList<T>where
T: Sync,
impl<T> Unpin for ExpLinkedList<T>
impl<T> UnwindSafe for ExpLinkedList<T>where
T: RefUnwindSafe + UnwindSafe,
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<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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>
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>
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<'a, I> MultiOps<&'a RoaringBitmap> for Iwhere
I: IntoIterator<Item = &'a RoaringBitmap>,
impl<'a, I> MultiOps<&'a RoaringBitmap> for Iwhere
I: IntoIterator<Item = &'a RoaringBitmap>,
Source§type Output = RoaringBitmap
type Output = RoaringBitmap
Source§fn intersection(self) -> <I as MultiOps<&'a RoaringBitmap>>::Output
fn intersection(self) -> <I as MultiOps<&'a RoaringBitmap>>::Output
intersection
between all elements.Source§fn difference(self) -> <I as MultiOps<&'a RoaringBitmap>>::Output
fn difference(self) -> <I as MultiOps<&'a RoaringBitmap>>::Output
difference
between all elements.Source§fn symmetric_difference(self) -> <I as MultiOps<&'a RoaringBitmap>>::Output
fn symmetric_difference(self) -> <I as MultiOps<&'a RoaringBitmap>>::Output
symmetric difference
between all elements.Source§impl<'a, I> MultiOps<&'a RoaringTreemap> for Iwhere
I: IntoIterator<Item = &'a RoaringTreemap>,
impl<'a, I> MultiOps<&'a RoaringTreemap> for Iwhere
I: IntoIterator<Item = &'a RoaringTreemap>,
Source§type Output = RoaringTreemap
type Output = RoaringTreemap
Source§fn intersection(self) -> <I as MultiOps<&'a RoaringTreemap>>::Output
fn intersection(self) -> <I as MultiOps<&'a RoaringTreemap>>::Output
intersection
between all elements.Source§fn difference(self) -> <I as MultiOps<&'a RoaringTreemap>>::Output
fn difference(self) -> <I as MultiOps<&'a RoaringTreemap>>::Output
difference
between all elements.Source§fn symmetric_difference(self) -> <I as MultiOps<&'a RoaringTreemap>>::Output
fn symmetric_difference(self) -> <I as MultiOps<&'a RoaringTreemap>>::Output
symmetric difference
between all elements.Source§impl<'a, I, E> MultiOps<Result<&'a RoaringBitmap, E>> for I
impl<'a, I, E> MultiOps<Result<&'a RoaringBitmap, E>> for I
Source§type Output = Result<RoaringBitmap, E>
type Output = Result<RoaringBitmap, E>
Source§fn union(self) -> <I as MultiOps<Result<&'a RoaringBitmap, E>>>::Output
fn union(self) -> <I as MultiOps<Result<&'a RoaringBitmap, E>>>::Output
union
between all elements.Source§fn intersection(self) -> <I as MultiOps<Result<&'a RoaringBitmap, E>>>::Output
fn intersection(self) -> <I as MultiOps<Result<&'a RoaringBitmap, E>>>::Output
intersection
between all elements.Source§fn difference(self) -> <I as MultiOps<Result<&'a RoaringBitmap, E>>>::Output
fn difference(self) -> <I as MultiOps<Result<&'a RoaringBitmap, E>>>::Output
difference
between all elements.Source§fn symmetric_difference(
self,
) -> <I as MultiOps<Result<&'a RoaringBitmap, E>>>::Output
fn symmetric_difference( self, ) -> <I as MultiOps<Result<&'a RoaringBitmap, E>>>::Output
symmetric difference
between all elements.Source§impl<'a, I, E> MultiOps<Result<&'a RoaringTreemap, E>> for I
impl<'a, I, E> MultiOps<Result<&'a RoaringTreemap, E>> for I
Source§type Output = Result<RoaringTreemap, E>
type Output = Result<RoaringTreemap, E>
Source§fn union(self) -> <I as MultiOps<Result<&'a RoaringTreemap, E>>>::Output
fn union(self) -> <I as MultiOps<Result<&'a RoaringTreemap, E>>>::Output
union
between all elements.Source§fn intersection(self) -> <I as MultiOps<Result<&'a RoaringTreemap, E>>>::Output
fn intersection(self) -> <I as MultiOps<Result<&'a RoaringTreemap, E>>>::Output
intersection
between all elements.Source§fn difference(self) -> <I as MultiOps<Result<&'a RoaringTreemap, E>>>::Output
fn difference(self) -> <I as MultiOps<Result<&'a RoaringTreemap, E>>>::Output
difference
between all elements.Source§fn symmetric_difference(
self,
) -> <I as MultiOps<Result<&'a RoaringTreemap, E>>>::Output
fn symmetric_difference( self, ) -> <I as MultiOps<Result<&'a RoaringTreemap, E>>>::Output
symmetric difference
between all elements.Source§impl<I, E> MultiOps<Result<RoaringBitmap, E>> for I
impl<I, E> MultiOps<Result<RoaringBitmap, E>> for I
Source§type Output = Result<RoaringBitmap, E>
type Output = Result<RoaringBitmap, E>
Source§fn union(self) -> <I as MultiOps<Result<RoaringBitmap, E>>>::Output
fn union(self) -> <I as MultiOps<Result<RoaringBitmap, E>>>::Output
union
between all elements.Source§fn intersection(self) -> <I as MultiOps<Result<RoaringBitmap, E>>>::Output
fn intersection(self) -> <I as MultiOps<Result<RoaringBitmap, E>>>::Output
intersection
between all elements.Source§fn difference(self) -> <I as MultiOps<Result<RoaringBitmap, E>>>::Output
fn difference(self) -> <I as MultiOps<Result<RoaringBitmap, E>>>::Output
difference
between all elements.Source§fn symmetric_difference(
self,
) -> <I as MultiOps<Result<RoaringBitmap, E>>>::Output
fn symmetric_difference( self, ) -> <I as MultiOps<Result<RoaringBitmap, E>>>::Output
symmetric difference
between all elements.Source§impl<I, E> MultiOps<Result<RoaringTreemap, E>> for I
impl<I, E> MultiOps<Result<RoaringTreemap, E>> for I
Source§type Output = Result<RoaringTreemap, E>
type Output = Result<RoaringTreemap, E>
Source§fn union(self) -> <I as MultiOps<Result<RoaringTreemap, E>>>::Output
fn union(self) -> <I as MultiOps<Result<RoaringTreemap, E>>>::Output
union
between all elements.Source§fn intersection(self) -> <I as MultiOps<Result<RoaringTreemap, E>>>::Output
fn intersection(self) -> <I as MultiOps<Result<RoaringTreemap, E>>>::Output
intersection
between all elements.Source§fn difference(self) -> <I as MultiOps<Result<RoaringTreemap, E>>>::Output
fn difference(self) -> <I as MultiOps<Result<RoaringTreemap, E>>>::Output
difference
between all elements.Source§fn symmetric_difference(
self,
) -> <I as MultiOps<Result<RoaringTreemap, E>>>::Output
fn symmetric_difference( self, ) -> <I as MultiOps<Result<RoaringTreemap, E>>>::Output
symmetric difference
between all elements.Source§impl<I> MultiOps<RoaringBitmap> for Iwhere
I: IntoIterator<Item = RoaringBitmap>,
impl<I> MultiOps<RoaringBitmap> for Iwhere
I: IntoIterator<Item = RoaringBitmap>,
Source§type Output = RoaringBitmap
type Output = RoaringBitmap
Source§fn intersection(self) -> <I as MultiOps<RoaringBitmap>>::Output
fn intersection(self) -> <I as MultiOps<RoaringBitmap>>::Output
intersection
between all elements.Source§fn difference(self) -> <I as MultiOps<RoaringBitmap>>::Output
fn difference(self) -> <I as MultiOps<RoaringBitmap>>::Output
difference
between all elements.Source§fn symmetric_difference(self) -> <I as MultiOps<RoaringBitmap>>::Output
fn symmetric_difference(self) -> <I as MultiOps<RoaringBitmap>>::Output
symmetric difference
between all elements.Source§impl<I> MultiOps<RoaringTreemap> for Iwhere
I: IntoIterator<Item = RoaringTreemap>,
impl<I> MultiOps<RoaringTreemap> for Iwhere
I: IntoIterator<Item = RoaringTreemap>,
Source§type Output = RoaringTreemap
type Output = RoaringTreemap
Source§fn intersection(self) -> <I as MultiOps<RoaringTreemap>>::Output
fn intersection(self) -> <I as MultiOps<RoaringTreemap>>::Output
intersection
between all elements.Source§fn difference(self) -> <I as MultiOps<RoaringTreemap>>::Output
fn difference(self) -> <I as MultiOps<RoaringTreemap>>::Output
difference
between all elements.Source§fn symmetric_difference(self) -> <I as MultiOps<RoaringTreemap>>::Output
fn symmetric_difference(self) -> <I as MultiOps<RoaringTreemap>>::Output
symmetric difference
between all elements.