[][src]Struct pvec::core::RbVec

pub struct RbVec<T> { /* fields omitted */ }

A persistent vector based on the balanced RbTree.

Methods

impl<T: Clone + Debug> RbVec<T>[src]

pub fn new() -> Self[src]

Constructs a new, empty vector. The vector allocates a buffer equal to the selected branching factor size.

pub fn push(&mut self, item: T)[src]

Adds an element to the back of a collection.

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

Removes the last element from a vector and returns it, or None if it is empty.

pub fn get(&self, index: usize) -> Option<&T>[src]

Returns a reference to an element at the given position or None if out of bounds.

pub fn get_mut(&mut self, index: usize) -> Option<&mut T>[src]

Returns a mutable reference to an element at the given position or None if out of bounds.

pub fn len(&self) -> usize[src]

Returns the number of elements in the vector.

pub fn is_empty(&self) -> bool[src]

Returns true if the vector has a length of 0.

impl<T: Clone + Debug> RbVec<T>[src]

pub fn split_off(&mut self, mid: usize) -> Self[src]

Splits the collection into two at the given index.

Returns a newly allocated vector containing the elements in the range [at, len). After the call, the original vector will be left containing the elements [0, at).

pub fn append(&mut self, that: &mut RbVec<T>)[src]

Moves all the elements of that into Self, leaving other empty.

Trait Implementations

impl<T: Clone> Clone for RbVec<T>[src]

impl<T: Debug> Debug for RbVec<T>[src]

impl<T: Clone + Debug> Default for RbVec<T>[src]

impl<T: Eq> Eq for RbVec<T>[src]

impl<T: Clone + Debug> FromIterator<T> for RbVec<T>[src]

impl<T: Clone + Debug> Index<usize> for RbVec<T>[src]

type Output = T

The returned type after indexing.

impl<T: Clone + Debug> IndexMut<usize> for RbVec<T>[src]

impl<T: Clone + Debug> IntoIterator for RbVec<T>[src]

type Item = T

The type of the elements being iterated over.

type IntoIter = RbVecIter<T>

Which kind of iterator are we turning this into?

impl<T: Ord> Ord for RbVec<T>[src]

impl<T: PartialEq> PartialEq<RbVec<T>> for RbVec<T>[src]

impl<T: PartialOrd> PartialOrd<RbVec<T>> for RbVec<T>[src]

impl<T> StructuralEq for RbVec<T>[src]

impl<T> StructuralPartialEq for RbVec<T>[src]

Auto Trait Implementations

impl<T> !RefUnwindSafe for RbVec<T>

impl<T> !Send for RbVec<T>

impl<T> !Sync for RbVec<T>

impl<T> Unpin for RbVec<T> where
    T: Unpin

impl<T> !UnwindSafe for RbVec<T>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<I> IntoIterator for I where
    I: Iterator
[src]

type Item = <I as Iterator>::Item

The type of the elements being iterated over.

type IntoIter = I

Which kind of iterator are we turning this into?

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.