pub struct BaseAppendList<T, V> { /* private fields */ }Expand description
A list that can be appended to while elements are borrowed
Uses pointer tagging to track allocated chunks of a fixed size.
Indexing is O(1)
Implementations§
Source§impl<T, V> BaseAppendList<T, V>
impl<T, V> BaseAppendList<T, V>
pub fn new() -> Self
Sourcepub fn get_mut(&mut self, index: usize) -> Option<&mut T>
pub fn get_mut(&mut self, index: usize) -> Option<&mut T>
Get an item from the list, if it is in bounds
Returns None if the index is out-of-bounds. Note that you can also
index with [], which will panic on out-of-bounds.
pub fn drain_all<'a>(&'a mut self) -> Drain<'a, T> ⓘ
pub fn len(&self) -> usize
pub fn capacity(&self) -> usize
pub fn is_empty(&self) -> bool
pub fn extend<I: IntoIterator<Item = T>>(&self, iter: I)
Source§impl<T> BaseAppendList<T, PushMut>
impl<T> BaseAppendList<T, PushMut>
Source§impl<T> BaseAppendList<T, Index>
impl<T> BaseAppendList<T, Index>
Sourcepub fn push(&self, item: T) -> &T
pub fn push(&self, item: T) -> &T
Append an item to the end
Note that this does not require mut.
Trait Implementations§
Source§impl<T, V> Default for BaseAppendList<T, V>
impl<T, V> Default for BaseAppendList<T, V>
Source§impl<T, V> Extend<T> for BaseAppendList<T, V>
impl<T, V> Extend<T> for BaseAppendList<T, V>
Source§fn extend<I: IntoIterator<Item = T>>(&mut self, iter: I)
fn extend<I: IntoIterator<Item = T>>(&mut self, iter: I)
Extends a collection with the contents of an iterator. Read more
Source§fn extend_one(&mut self, item: A)
fn extend_one(&mut self, item: A)
🔬This is a nightly-only experimental API. (
extend_one)Extends a collection with exactly one element.
Source§fn extend_reserve(&mut self, additional: usize)
fn extend_reserve(&mut self, additional: usize)
🔬This is a nightly-only experimental API. (
extend_one)Reserves capacity in a collection for the given number of additional elements. Read more
Source§impl<T, V> FromIterator<T> for BaseAppendList<T, V>
impl<T, V> FromIterator<T> for BaseAppendList<T, V>
Source§fn from_iter<I: IntoIterator<Item = T>>(iter: I) -> Self
fn from_iter<I: IntoIterator<Item = T>>(iter: I) -> Self
Creates a value from an iterator. Read more
Source§impl<'a, T> IntoIterator for &'a BaseAppendList<T, Index>
impl<'a, T> IntoIterator for &'a BaseAppendList<T, Index>
Auto Trait Implementations§
impl<T, V> !Freeze for BaseAppendList<T, V>
impl<T, V> !RefUnwindSafe for BaseAppendList<T, V>
impl<T, V> !Send for BaseAppendList<T, V>
impl<T, V> !Sync for BaseAppendList<T, V>
impl<T, V> Unpin for BaseAppendList<T, V>where
V: Unpin,
impl<T, V> UnwindSafe for BaseAppendList<T, V>where
V: UnwindSafe,
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
Mutably borrows from an owned value. Read more