Struct aoe2_probe::prebuilt::CONDITION_SCHEME
source · pub struct CONDITION_SCHEME { /* private fields */ }
Methods from Deref<Target = LinkedHashMap<i32, ConditionConfig>>§
sourcepub fn contains_key<Q>(&self, k: &Q) -> boolwhere
K: Borrow<Q>,
Q: Eq + Hash + ?Sized,
pub fn contains_key<Q>(&self, k: &Q) -> boolwhere K: Borrow<Q>, Q: Eq + Hash + ?Sized,
Checks if the map contains the given key.
sourcepub fn get<Q>(&self, k: &Q) -> Option<&V>where
K: Borrow<Q>,
Q: Eq + Hash + ?Sized,
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"));
sourcepub fn capacity(&self) -> usize
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();
sourcepub fn front(&self) -> Option<(&K, &V)>
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)));
sourcepub fn back(&self) -> Option<(&K, &V)>
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)));
sourcepub fn iter(&self) -> Iter<'_, K, V>
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());
sourcepub fn keys(&self) -> Keys<'_, K, V>
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());
sourcepub fn values(&self) -> Values<'_, K, V>
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
impl Deref for CONDITION_SCHEME
§type Target = LinkedHashMap<i32, ConditionConfig, RandomState>
type Target = LinkedHashMap<i32, ConditionConfig, RandomState>
The resulting type after dereferencing.
source§fn deref(&self) -> &LinkedHashMap<i32, ConditionConfig>
fn deref(&self) -> &LinkedHashMap<i32, ConditionConfig>
Dereferences the value.
impl LazyStatic for CONDITION_SCHEME
Auto Trait Implementations§
impl RefUnwindSafe for CONDITION_SCHEME
impl Send for CONDITION_SCHEME
impl Sync for CONDITION_SCHEME
impl Unpin for CONDITION_SCHEME
impl UnwindSafe for CONDITION_SCHEME
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