Implementations
sourceimpl<K: Eq + Hash, V> HashVec<K, V>
impl<K: Eq + Hash, V> HashVec<K, V>
sourcepub fn with_capacity(capacity: usize) -> HashVec<K, V>
pub fn with_capacity(capacity: usize) -> HashVec<K, V>
Creates a new, empty hashvec with the specified capacity.
sourcepub fn capacity(&self) -> usize
pub fn capacity(&self) -> usize
Returns the number of elements the hashvec can hold without reallocating.
sourcepub fn clear(&mut self)
pub fn clear(&mut self)
Clears the hashvec, removing all entries.
Keep in mind this will not reallocate memory.
sourcepub fn insert(&mut self, k: K, v: V)
pub fn insert(&mut self, k: K, v: V)
Inserts an entry into the hashvec, or replaces an existing one
sourcepub fn get(&self, k: K) -> Option<&V>
pub fn get(&self, k: K) -> Option<&V>
Returns a reference to the value corresponding to the key, if it exists.
sourcepub fn get_mut(&mut self, k: K) -> Option<&mut V>
pub fn get_mut(&mut self, k: K) -> Option<&mut V>
Returns a mutable reference to the value corresponding to the key, if it exists.
sourcepub fn remove_entry(&mut self, k: K) -> Option<(K, V)>
pub fn remove_entry(&mut self, k: K) -> Option<(K, V)>
Removes a key from the hashvec, returning the stored key and value if the key was previously in the hashvec.
Trait Implementations
sourceimpl<'a, K: Eq + Hash, V> IntoIterator for &'a HashVec<K, V>
impl<'a, K: Eq + Hash, V> IntoIterator for &'a HashVec<K, V>
Auto Trait Implementations
impl<K, V> RefUnwindSafe for HashVec<K, V> where
K: RefUnwindSafe,
V: RefUnwindSafe,
impl<K, V> Send for HashVec<K, V> where
K: Send,
V: Send,
impl<K, V> Sync for HashVec<K, V> where
K: Sync,
V: Sync,
impl<K, V> Unpin for HashVec<K, V> where
K: Unpin,
V: Unpin,
impl<K, V> UnwindSafe for HashVec<K, V> where
K: UnwindSafe,
V: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more