ExpLinkedList

Struct ExpLinkedList 

Source
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>

Source

pub fn new() -> Self

Creates a new empty ExpLinkedList.

Source

pub fn with_capacity(capacity: usize) -> Self

Source

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.

Source

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.

Source

pub fn pop(&mut self) -> Option<T>

Removes the last element from the list.

Source

pub fn clear(&mut self)

Clears the list, removing all elements. This will free the memory used by the list.

Source

pub fn len(&self) -> usize

Returns the number of elements in the list.

Source

pub fn is_empty(&self) -> bool

Returns whether the list is empty.

Source

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.

Source

pub fn iter(&self) -> ExpLinkedListIter<'_, T>

Returns an iterator over the elements in the list.

Source

pub fn block_iter(&self) -> impl Iterator<Item = &[T]>

Trait Implementations§

Source§

impl<T: Clone> Clone for ExpLinkedList<T>

Source§

fn clone(&self) -> ExpLinkedList<T>

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<T: Debug> Debug for ExpLinkedList<T>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<T: DeepSizeOf> DeepSizeOf for ExpLinkedList<T>

Source§

fn deep_size_of_children(&self, context: &mut Context) -> usize

Returns an estimation of the heap-managed storage of this object. This does not include the size of the object itself. Read more
Source§

fn deep_size_of(&self) -> usize

Returns an estimation of a total size of memory owned by the object, including heap-managed storage. Read more
Source§

impl<T: Default> Default for ExpLinkedList<T>

Source§

fn default() -> ExpLinkedList<T>

Returns the “default value” for a type. Read more
Source§

impl<T> FromIterator<T> for ExpLinkedList<T>

Source§

fn from_iter<I: IntoIterator<Item = T>>(iter: I) -> Self

Creates a value from an iterator. Read more
Source§

impl<T> IntoIterator for ExpLinkedList<T>

Source§

type Item = T

The type of the elements being iterated over.
Source§

type IntoIter = ExpLinkedListIntoIter<T>

Which kind of iterator are we turning this into?
Source§

fn into_iter(self) -> Self::IntoIter

Creates an iterator from a value. Read more
Source§

impl<T> PartialEq for ExpLinkedList<T>
where T: PartialEq,

Source§

fn eq(&self, other: &Self) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

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>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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 more
Source§

impl<'a, I> MultiOps<&'a RoaringBitmap> for I
where I: IntoIterator<Item = &'a RoaringBitmap>,

Source§

type Output = RoaringBitmap

The type of output from operations.
Source§

fn union(self) -> <I as MultiOps<&'a RoaringBitmap>>::Output

The union between all elements.
Source§

fn intersection(self) -> <I as MultiOps<&'a RoaringBitmap>>::Output

The intersection between all elements.
Source§

fn difference(self) -> <I as MultiOps<&'a RoaringBitmap>>::Output

The difference between all elements.
Source§

fn symmetric_difference(self) -> <I as MultiOps<&'a RoaringBitmap>>::Output

The symmetric difference between all elements.
Source§

impl<'a, I> MultiOps<&'a RoaringTreemap> for I
where I: IntoIterator<Item = &'a RoaringTreemap>,

Source§

type Output = RoaringTreemap

The type of output from operations.
Source§

fn union(self) -> <I as MultiOps<&'a RoaringTreemap>>::Output

The union between all elements.
Source§

fn intersection(self) -> <I as MultiOps<&'a RoaringTreemap>>::Output

The intersection between all elements.
Source§

fn difference(self) -> <I as MultiOps<&'a RoaringTreemap>>::Output

The difference between all elements.
Source§

fn symmetric_difference(self) -> <I as MultiOps<&'a RoaringTreemap>>::Output

The symmetric difference between all elements.
Source§

impl<'a, I, E> MultiOps<Result<&'a RoaringBitmap, E>> for I
where E: 'a, I: IntoIterator<Item = Result<&'a RoaringBitmap, E>>,

Source§

type Output = Result<RoaringBitmap, E>

The type of output from operations.
Source§

fn union(self) -> <I as MultiOps<Result<&'a RoaringBitmap, E>>>::Output

The union between all elements.
Source§

fn intersection(self) -> <I as MultiOps<Result<&'a RoaringBitmap, E>>>::Output

The intersection between all elements.
Source§

fn difference(self) -> <I as MultiOps<Result<&'a RoaringBitmap, E>>>::Output

The difference between all elements.
Source§

fn symmetric_difference( self, ) -> <I as MultiOps<Result<&'a RoaringBitmap, E>>>::Output

The symmetric difference between all elements.
Source§

impl<'a, I, E> MultiOps<Result<&'a RoaringTreemap, E>> for I
where E: 'a, I: IntoIterator<Item = Result<&'a RoaringTreemap, E>>,

Source§

type Output = Result<RoaringTreemap, E>

The type of output from operations.
Source§

fn union(self) -> <I as MultiOps<Result<&'a RoaringTreemap, E>>>::Output

The union between all elements.
Source§

fn intersection(self) -> <I as MultiOps<Result<&'a RoaringTreemap, E>>>::Output

The intersection between all elements.
Source§

fn difference(self) -> <I as MultiOps<Result<&'a RoaringTreemap, E>>>::Output

The difference between all elements.
Source§

fn symmetric_difference( self, ) -> <I as MultiOps<Result<&'a RoaringTreemap, E>>>::Output

The symmetric difference between all elements.
Source§

impl<I, E> MultiOps<Result<RoaringBitmap, E>> for I
where I: IntoIterator<Item = Result<RoaringBitmap, E>>,

Source§

type Output = Result<RoaringBitmap, E>

The type of output from operations.
Source§

fn union(self) -> <I as MultiOps<Result<RoaringBitmap, E>>>::Output

The union between all elements.
Source§

fn intersection(self) -> <I as MultiOps<Result<RoaringBitmap, E>>>::Output

The intersection between all elements.
Source§

fn difference(self) -> <I as MultiOps<Result<RoaringBitmap, E>>>::Output

The difference between all elements.
Source§

fn symmetric_difference( self, ) -> <I as MultiOps<Result<RoaringBitmap, E>>>::Output

The symmetric difference between all elements.
Source§

impl<I, E> MultiOps<Result<RoaringTreemap, E>> for I
where I: IntoIterator<Item = Result<RoaringTreemap, E>>,

Source§

type Output = Result<RoaringTreemap, E>

The type of output from operations.
Source§

fn union(self) -> <I as MultiOps<Result<RoaringTreemap, E>>>::Output

The union between all elements.
Source§

fn intersection(self) -> <I as MultiOps<Result<RoaringTreemap, E>>>::Output

The intersection between all elements.
Source§

fn difference(self) -> <I as MultiOps<Result<RoaringTreemap, E>>>::Output

The difference between all elements.
Source§

fn symmetric_difference( self, ) -> <I as MultiOps<Result<RoaringTreemap, E>>>::Output

The symmetric difference between all elements.
Source§

impl<I> MultiOps<RoaringBitmap> for I
where I: IntoIterator<Item = RoaringBitmap>,

Source§

type Output = RoaringBitmap

The type of output from operations.
Source§

fn union(self) -> <I as MultiOps<RoaringBitmap>>::Output

The union between all elements.
Source§

fn intersection(self) -> <I as MultiOps<RoaringBitmap>>::Output

The intersection between all elements.
Source§

fn difference(self) -> <I as MultiOps<RoaringBitmap>>::Output

The difference between all elements.
Source§

fn symmetric_difference(self) -> <I as MultiOps<RoaringBitmap>>::Output

The symmetric difference between all elements.
Source§

impl<I> MultiOps<RoaringTreemap> for I
where I: IntoIterator<Item = RoaringTreemap>,

Source§

type Output = RoaringTreemap

The type of output from operations.
Source§

fn union(self) -> <I as MultiOps<RoaringTreemap>>::Output

The union between all elements.
Source§

fn intersection(self) -> <I as MultiOps<RoaringTreemap>>::Output

The intersection between all elements.
Source§

fn difference(self) -> <I as MultiOps<RoaringTreemap>>::Output

The difference between all elements.
Source§

fn symmetric_difference(self) -> <I as MultiOps<RoaringTreemap>>::Output

The symmetric difference between all elements.
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> Allocation for T
where T: RefUnwindSafe + Send + Sync,

Source§

impl<T> ErasedDestructor for T
where T: 'static,