pub struct PVec<T>(/* private fields */);Expand description
A persistent vector that is backed by the flat representation - the standard vector, or the tree-based vector when cloned.
Implementations§
Source§impl<T: Clone + Debug> PVec<T>
impl<T: Clone + Debug> PVec<T>
Sourcepub fn new_with_tree() -> Self
pub fn new_with_tree() -> Self
Constructs a new, empty vector backed by the RrbVec.
Sourcepub fn pop(&mut self) -> Option<T>
pub fn pop(&mut self) -> Option<T>
Removes the last element from a vector and returns it, or None if it is empty.
Sourcepub fn get(&self, index: usize) -> Option<&T>
pub fn get(&self, index: usize) -> Option<&T>
Returns a reference to an element at the given position or None if out of bounds.
Sourcepub fn get_mut(&mut self, index: usize) -> Option<&mut T>
pub fn get_mut(&mut self, index: usize) -> Option<&mut T>
Returns a mutable reference to an element at the given position or None if out of bounds.
Trait Implementations§
Source§impl<T: Clone + Debug> FromIterator<T> for PVec<T>
impl<T: Clone + Debug> FromIterator<T> for PVec<T>
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<T: Ord> Ord for PVec<T>
impl<T: Ord> Ord for PVec<T>
Source§impl<T: PartialOrd> PartialOrd for PVec<T>
impl<T: PartialOrd> PartialOrd for PVec<T>
impl<T: Eq> Eq for PVec<T>
impl<T> StructuralPartialEq for PVec<T>
Auto Trait Implementations§
impl<T> Freeze for PVec<T>where
T: Freeze,
impl<T> RefUnwindSafe for PVec<T>where
T: RefUnwindSafe,
impl<T> !Send for PVec<T>
impl<T> !Sync for PVec<T>
impl<T> Unpin for PVec<T>where
T: Unpin,
impl<T> UnsafeUnpin for PVec<T>where
T: UnsafeUnpin,
impl<T> UnwindSafe for PVec<T>where
T: UnwindSafe + 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