[][src]Struct keylist::Keylist

pub struct Keylist<K, V>(pub Vec<(K, V)>);

Implementations

impl<K, V> Keylist<K, V>[src]

pub fn new() -> Self[src]

pub fn into_swapped(self) -> Keylist<V, K>[src]

pub fn insert(&mut self, index: usize, k: K, v: V)[src]

pub fn push(&mut self, k: K, v: V)[src]

pub fn pop(&mut self) -> Option<(K, V)>[src]

pub fn remove(&mut self, index: usize) -> (K, V)[src]

pub fn iter<'a>(&'a self) -> impl Iterator<Item = &'a (K, V)>[src]

pub fn iter_mut<'a>(&'a mut self) -> impl Iterator<Item = &'a mut (K, V)>[src]

pub fn keys<'a>(&'a self) -> impl Iterator<Item = &'a K>[src]

pub fn keys_mut<'a>(&'a mut self) -> impl Iterator<Item = &'a mut K>[src]

pub fn values<'a>(&'a self) -> impl Iterator<Item = &'a V>[src]

pub fn values_mut<'a>(&'a mut self) -> impl Iterator<Item = &'a mut V>[src]

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

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

impl<K: PartialEq, V> Keylist<K, V>[src]

pub fn get_key_value(&self, key: &K) -> Option<&(K, V)>[src]

pub fn get_key_value_mut(&mut self, key: &K) -> Option<&mut (K, V)>[src]

pub fn get(&self, key: &K) -> Option<&V>[src]

pub fn get_mut(&mut self, key: &K) -> Option<&mut V>[src]

pub fn get_all_get_key_value(&self, key: &K) -> Vec<&(K, V)>[src]

pub fn get_all(&self, key: &K) -> Vec<&V>[src]

get all values matching the key

impl<K: Ord, V> Keylist<K, V>[src]

pub fn sort_by_key<'a>(&'a mut self)[src]

impl<K, V: Ord> Keylist<K, V>[src]

pub fn sort_by_value<'a>(&'a mut self)[src]

impl<K: PartialEq, V: PartialEq> Keylist<K, V>[src]

pub fn contains(&self, item: &(K, V)) -> bool[src]

impl<K: Ord, V: Ord> Keylist<K, V>[src]

pub fn sort(&mut self)[src]

pub fn get_key_value_sorted(&self, key: &K) -> Option<&(K, V)>[src]

The normal get function uses a find on a iterator to find the key value This function uses binary search to find the key value

pub fn get_sorted(&self, key: &K) -> Option<&V>[src]

The normal get function uses a find on a iterator to find the value This function uses binary search to find the value

Trait Implementations

impl<K: Clone, V: Clone> Clone for Keylist<K, V>[src]

impl<K: Debug, V: Debug> Debug for Keylist<K, V>[src]

impl<'a, K: Copy, V: Copy> Extend<(&'a K, &'a V)> for Keylist<K, V>[src]

impl<K, V> Extend<(K, V)> for Keylist<K, V>[src]

impl<K, V> From<Vec<(K, V)>> for Keylist<K, V>[src]

impl<K, V> FromIterator<(K, V)> for Keylist<K, V>[src]

impl<K, V> IntoIterator for Keylist<K, V>[src]

type Item = (K, V)

The type of the elements being iterated over.

type IntoIter = IntoIter<(K, V)>

Which kind of iterator are we turning this into?

impl<K: PartialEq, V: PartialEq> PartialEq<Keylist<K, V>> for Keylist<K, V>[src]

impl<K, V> StructuralPartialEq for Keylist<K, V>[src]

Auto Trait Implementations

impl<K, V> RefUnwindSafe for Keylist<K, V> where
    K: RefUnwindSafe,
    V: RefUnwindSafe

impl<K, V> Send for Keylist<K, V> where
    K: Send,
    V: Send

impl<K, V> Sync for Keylist<K, V> where
    K: Sync,
    V: Sync

impl<K, V> Unpin for Keylist<K, V> where
    K: Unpin,
    V: Unpin

impl<K, V> UnwindSafe for Keylist<K, V> where
    K: UnwindSafe,
    V: UnwindSafe

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.