pub struct VecKeylist<K, V>(pub Vec<(K, V)>);
Tuple Fields§
§0: Vec<(K, V)>
Implementations§
Source§impl<K, V> VecKeylist<K, V>
impl<K, V> VecKeylist<K, V>
pub fn new() -> Self
pub fn into_swapped(self) -> VecKeylist<V, K>
pub fn insert(&mut self, index: usize, k: K, v: V)
pub fn push(&mut self, k: K, v: V)
pub fn pop(&mut self) -> Option<(K, V)>
pub fn remove(&mut self, index: usize) -> (K, V)
pub fn iter<'a>(&'a self) -> impl Iterator<Item = &'a (K, V)>
pub fn iter_mut<'a>(&'a mut self) -> impl Iterator<Item = &'a mut (K, V)>
pub fn keys<'a>(&'a self) -> impl Iterator<Item = &'a K>
pub fn keys_mut<'a>(&'a mut self) -> impl Iterator<Item = &'a mut K>
pub fn values<'a>(&'a self) -> impl Iterator<Item = &'a V>
pub fn values_mut<'a>(&'a mut self) -> impl Iterator<Item = &'a mut V>
pub fn is_empty(&self) -> bool
pub fn len(&self) -> usize
Source§impl<K: PartialEq, V> VecKeylist<K, V>
impl<K: PartialEq, V> VecKeylist<K, V>
pub fn get_key_value(&self, key: &K) -> Option<&(K, V)>
pub fn get_key_value_mut(&mut self, key: &K) -> Option<&mut (K, V)>
pub fn get(&self, key: &K) -> Option<&V>
pub fn get_mut(&mut self, key: &K) -> Option<&mut V>
pub fn get_all_get_key_value(&self, key: &K) -> Vec<&(K, V)>
Source§impl<K: Ord, V> VecKeylist<K, V>
impl<K: Ord, V> VecKeylist<K, V>
pub fn sort_by_key<'a>(&'a mut self)
Source§impl<K, V: Ord> VecKeylist<K, V>
impl<K, V: Ord> VecKeylist<K, V>
pub fn sort_by_value<'a>(&'a mut self)
Source§impl<K: PartialEq, V: PartialEq> VecKeylist<K, V>
impl<K: PartialEq, V: PartialEq> VecKeylist<K, V>
Source§impl<K: Ord, V: Ord> VecKeylist<K, V>
impl<K: Ord, V: Ord> VecKeylist<K, V>
pub fn sort(&mut self)
Sourcepub fn get_key_value_sorted(&self, key: &K) -> Option<&(K, V)>
pub fn get_key_value_sorted(&self, key: &K) -> Option<&(K, V)>
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
Sourcepub fn get_sorted(&self, key: &K) -> Option<&V>
pub fn get_sorted(&self, key: &K) -> Option<&V>
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§
Source§impl<'a, K: Copy, V: Copy> Extend<(&'a K, &'a V)> for VecKeylist<K, V>
impl<'a, K: Copy, V: Copy> Extend<(&'a K, &'a V)> for VecKeylist<K, V>
Source§fn extend<T: IntoIterator<Item = (&'a K, &'a V)>>(&mut self, iter: T)
fn extend<T: IntoIterator<Item = (&'a K, &'a V)>>(&mut self, iter: T)
Extends a collection with the contents of an iterator. Read more
Source§fn extend_one(&mut self, item: A)
fn extend_one(&mut self, item: A)
🔬This is a nightly-only experimental API. (
extend_one
)Extends a collection with exactly one element.
Source§fn extend_reserve(&mut self, additional: usize)
fn extend_reserve(&mut self, additional: usize)
🔬This is a nightly-only experimental API. (
extend_one
)Reserves capacity in a collection for the given number of additional elements. Read more
Source§impl<K, V> Extend<(K, V)> for VecKeylist<K, V>
impl<K, V> Extend<(K, V)> for VecKeylist<K, V>
Source§fn extend<T: IntoIterator<Item = (K, V)>>(&mut self, iter: T)
fn extend<T: IntoIterator<Item = (K, V)>>(&mut self, iter: T)
Extends a collection with the contents of an iterator. Read more
Source§fn extend_one(&mut self, item: A)
fn extend_one(&mut self, item: A)
🔬This is a nightly-only experimental API. (
extend_one
)Extends a collection with exactly one element.
Source§fn extend_reserve(&mut self, additional: usize)
fn extend_reserve(&mut self, additional: usize)
🔬This is a nightly-only experimental API. (
extend_one
)Reserves capacity in a collection for the given number of additional elements. Read more
Source§impl<K, V> FromIterator<(K, V)> for VecKeylist<K, V>
impl<K, V> FromIterator<(K, V)> for VecKeylist<K, V>
Source§fn from_iter<T: IntoIterator<Item = (K, V)>>(iter: T) -> VecKeylist<K, V>
fn from_iter<T: IntoIterator<Item = (K, V)>>(iter: T) -> VecKeylist<K, V>
Creates a value from an iterator. Read more
Source§impl<K, V> IntoIterator for VecKeylist<K, V>
impl<K, V> IntoIterator for VecKeylist<K, V>
impl<K, V> StructuralPartialEq for VecKeylist<K, V>
Auto Trait Implementations§
impl<K, V> Freeze for VecKeylist<K, V>
impl<K, V> RefUnwindSafe for VecKeylist<K, V>where
K: RefUnwindSafe,
V: RefUnwindSafe,
impl<K, V> Send for VecKeylist<K, V>
impl<K, V> Sync for VecKeylist<K, V>
impl<K, V> Unpin for VecKeylist<K, V>
impl<K, V> UnwindSafe for VecKeylist<K, V>where
K: UnwindSafe,
V: UnwindSafe,
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