pub struct CONDITION_SCHEME { /* private fields */ }

Methods from Deref<Target = LinkedHashMap<i32, ConditionConfig>>§

source

pub fn contains_key<Q>(&self, k: &Q) -> boolwhere K: Borrow<Q>, Q: Eq + Hash + ?Sized,

Checks if the map contains the given key.

source

pub fn get<Q>(&self, k: &Q) -> Option<&V>where K: Borrow<Q>, Q: Eq + Hash + ?Sized,

Returns the value corresponding to the key in the map.

Examples
use linked_hash_map::LinkedHashMap;
let mut map = LinkedHashMap::new();

map.insert(1, "a");
map.insert(2, "b");
map.insert(2, "c");
map.insert(3, "d");

assert_eq!(map.get(&1), Some(&"a"));
assert_eq!(map.get(&2), Some(&"c"));
source

pub fn capacity(&self) -> usize

Returns the maximum number of key-value pairs the map can hold without reallocating.

Examples
use linked_hash_map::LinkedHashMap;
let mut map: LinkedHashMap<i32, &str> = LinkedHashMap::new();
let capacity = map.capacity();
source

pub fn front(&self) -> Option<(&K, &V)>

Gets the first entry.

Examples
use linked_hash_map::LinkedHashMap;
let mut map = LinkedHashMap::new();
map.insert(1, 10);
map.insert(2, 20);
assert_eq!(map.front(), Some((&1, &10)));
source

pub fn back(&self) -> Option<(&K, &V)>

Gets the last entry.

Examples
use linked_hash_map::LinkedHashMap;
let mut map = LinkedHashMap::new();
map.insert(1, 10);
map.insert(2, 20);
assert_eq!(map.back(), Some((&2, &20)));
source

pub fn len(&self) -> usize

Returns the number of key-value pairs in the map.

source

pub fn is_empty(&self) -> bool

Returns whether the map is currently empty.

source

pub fn hasher(&self) -> &S

Returns a reference to the map’s hasher.

source

pub fn iter(&self) -> Iter<'_, K, V>

Returns a double-ended iterator visiting all key-value pairs in order of insertion. Iterator element type is (&'a K, &'a V)

Examples
use linked_hash_map::LinkedHashMap;

let mut map = LinkedHashMap::new();
map.insert("a", 10);
map.insert("c", 30);
map.insert("b", 20);

let mut iter = map.iter();
assert_eq!((&"a", &10), iter.next().unwrap());
assert_eq!((&"c", &30), iter.next().unwrap());
assert_eq!((&"b", &20), iter.next().unwrap());
assert_eq!(None, iter.next());
source

pub fn keys(&self) -> Keys<'_, K, V>

Returns a double-ended iterator visiting all key in order of insertion.

Examples
use linked_hash_map::LinkedHashMap;

let mut map = LinkedHashMap::new();
map.insert('a', 10);
map.insert('c', 30);
map.insert('b', 20);

let mut keys = map.keys();
assert_eq!(&'a', keys.next().unwrap());
assert_eq!(&'c', keys.next().unwrap());
assert_eq!(&'b', keys.next().unwrap());
assert_eq!(None, keys.next());
source

pub fn values(&self) -> Values<'_, K, V>

Returns a double-ended iterator visiting all values in order of insertion.

Examples
use linked_hash_map::LinkedHashMap;

let mut map = LinkedHashMap::new();
map.insert('a', 10);
map.insert('c', 30);
map.insert('b', 20);

let mut values = map.values();
assert_eq!(&10, values.next().unwrap());
assert_eq!(&30, values.next().unwrap());
assert_eq!(&20, values.next().unwrap());
assert_eq!(None, values.next());

Trait Implementations§

source§

impl Deref for CONDITION_SCHEME

§

type Target = LinkedHashMap<i32, ConditionConfig, RandomState>

The resulting type after dereferencing.
source§

fn deref(&self) -> &LinkedHashMap<i32, ConditionConfig>

Dereferences the value.
source§

impl LazyStatic for CONDITION_SCHEME

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

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

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.