[−][src]Struct sbral::skew_list::SkewList
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]
T: Clone,
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(&self) -> 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]
T: Clone,
type Item = T
The type of the elements being iterated over.
type IntoIter = IntoIter<T>
Which kind of iterator are we turning this into?
fn into_iter(self) -> Self::IntoIter
[src]
impl<T> Extend<T> for SkewList<T> where
T: Clone,
[src]
T: Clone,
fn extend<I>(&mut self, iter: I) where
I: IntoIterator<Item = T>,
[src]
I: IntoIterator<Item = T>,
impl<T: PartialOrd> PartialOrd<SkewList<T>> for SkewList<T>
[src]
fn partial_cmp(&self, other: &SkewList<T>) -> Option<Ordering>
[src]
fn lt(&self, other: &SkewList<T>) -> bool
[src]
fn le(&self, other: &SkewList<T>) -> bool
[src]
fn gt(&self, other: &SkewList<T>) -> bool
[src]
fn ge(&self, other: &SkewList<T>) -> bool
[src]
impl<T: Eq> Eq for SkewList<T>
[src]
impl<T: Ord> Ord for SkewList<T>
[src]
fn cmp(&self, other: &SkewList<T>) -> Ordering
[src]
fn max(self, other: Self) -> Self
1.21.0[src]
Compares and returns the maximum of two values. Read more
fn min(self, other: Self) -> Self
1.21.0[src]
Compares and returns the minimum of two values. Read more
fn clamp(self, min: Self, max: Self) -> Self
[src]
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.
fn index(&self, index: usize) -> &Self::Output
[src]
impl<T> IndexMut<usize> for SkewList<T> where
T: Clone,
[src]
T: Clone,
impl<T: Hash> Hash for SkewList<T>
[src]
fn hash<__HT: Hasher>(&self, state: &mut __HT)
[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
Feeds a slice of this type into the given [Hasher
]. Read more
impl<T> FromIterator<T> for SkewList<T> where
T: Clone,
[src]
T: Clone,
fn from_iter<I>(iter: I) -> Self where
I: IntoIterator<Item = T>,
[src]
I: IntoIterator<Item = T>,
Auto Trait Implementations
impl<T> Unpin for SkewList<T> where
T: Unpin,
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]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<I> IntoIterator for I where
I: Iterator,
[src]
I: Iterator,
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?
fn into_iter(self) -> I
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,