[][src]Struct sbral::skew_list::SkewList

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

Methods

impl<T> SkewList<T>[src]

pub fn new() -> Self[src]

Create an empty SkewList.

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

Retrieve an element by index. This takes O(log index): accessing elements near the front of the list is faster than ones toward the back, but never slower than O(log N).

Important traits for Iter<'a, T>
pub fn iter(&self) -> Iter<T>[src]

Return an iterator over the elements of the list.

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

Get the length of the list. This is O(log N) - if you need to refer to it often, track it outside of the list!

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

Returns whether the list contains any elements. This is O(1), but if you store the length externally you should compare that to 0 instead.

impl<T> SkewList<T> where
    T: Clone
[src]

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

Prepend a new element to the front of the list. This is O(1).

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

Get a mutable reference to an element, cloning as necessary. This takes O(log index).

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

Pop an element from the front of the list. This is O(1).

Trait Implementations

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

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

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl<T> Default for SkewList<T>[src]

impl<T> IntoIterator for SkewList<T> where
    T: Clone
[src]

type Item = T

The type of the elements being iterated over.

type IntoIter = IntoIter<T>

Which kind of iterator are we turning this into?

impl<T> Extend<T> for SkewList<T> where
    T: Clone
[src]

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

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

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

fn max(self, other: Self) -> Self1.21.0[src]

Compares and returns the maximum of two values. Read more

fn min(self, other: Self) -> Self1.21.0[src]

Compares and returns the minimum of two values. Read more

fn clamp(self, min: Self, max: Self) -> Self[src]

🔬 This is a nightly-only experimental API. (clamp)

Restrict a value to a certain interval. Read more

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

impl<T> Index<usize> for SkewList<T>[src]

type Output = T

The returned type after indexing.

impl<T> IndexMut<usize> for SkewList<T> where
    T: Clone
[src]

impl<T: Hash> Hash for SkewList<T>[src]

fn hash_slice<H>(data: &[Self], state: &mut H) where
    H: Hasher
1.3.0[src]

Feeds a slice of this type into the given [Hasher]. Read more

impl<T> FromIterator<T> for SkewList<T> where
    T: Clone
[src]

Auto Trait Implementations

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

impl<T> !Sync for SkewList<T>

impl<T> !Send for SkewList<T>

impl<T> !RefUnwindSafe for SkewList<T>

impl<T> !UnwindSafe for SkewList<T>

Blanket Implementations

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

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

type Owned = T

The resulting type after obtaining ownership.

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, U> Into<U> for T where
    U: From<T>, 
[src]

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.

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

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

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