pub struct HashMap<K: Hashable + Eq + Clone, V: Clone> { /* private fields */ }
Implementations§
Source§impl<K: Hashable + Eq + Clone, V: Clone> HashMap<K, V>
impl<K: Hashable + Eq + Clone, V: Clone> HashMap<K, V>
Sourcepub fn insert(&self, k: K, v: V) -> Self
pub fn insert(&self, k: K, v: V) -> Self
create and return a new map containing the new key, value pair
Sourcepub fn remove(&self, k: K) -> Self
pub fn remove(&self, k: K) -> Self
create and return a new map with the key, value pair removed
Sourcepub fn exist(&self, k: &K) -> bool
pub fn exist(&self, k: &K) -> bool
search for a key and return true if the key exist, false otherwise
Sourcepub fn find(&self, k: &K) -> Option<&V>
pub fn find(&self, k: &K) -> Option<&V>
search for a key and return a pointer to the value if the key exists, None otherwise
Trait Implementations§
Auto Trait Implementations§
impl<K, V> Freeze for HashMap<K, V>
impl<K, V> RefUnwindSafe for HashMap<K, V>where
K: RefUnwindSafe,
V: RefUnwindSafe,
impl<K, V> Send for HashMap<K, V>
impl<K, V> Sync for HashMap<K, V>
impl<K, V> Unpin for HashMap<K, V>
impl<K, V> UnwindSafe for HashMap<K, V>where
K: RefUnwindSafe,
V: RefUnwindSafe,
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