pub enum AutoMap<K, V, H = BuildHasherDefault<FxHasher>, const I: usize = 0> {
List(SmallVec<[(K, V); I]>),
Map(Box<HashMap<K, V, H>>),
}
Variants§
Implementations§
Source§impl<K, V> AutoMap<K, V, BuildHasherDefault<FxHasher>, 0>
impl<K, V> AutoMap<K, V, BuildHasherDefault<FxHasher>, 0>
Sourcepub const fn new() -> Self
pub const fn new() -> Self
see HashMap::new
Sourcepub fn with_capacity(capacity: usize) -> Self
pub fn with_capacity(capacity: usize) -> Self
Source§impl<K, V, H: BuildHasher, const I: usize> AutoMap<K, V, H, I>
impl<K, V, H: BuildHasher, const I: usize> AutoMap<K, V, H, I>
Sourcepub const fn with_hasher() -> Self
pub const fn with_hasher() -> Self
Sourcepub fn with_capacity_and_hasher(capacity: usize, hasher: H) -> Self
pub fn with_capacity_and_hasher(capacity: usize, hasher: H) -> Self
Sourcepub fn clear(&mut self)
pub fn clear(&mut self)
see HashMap::clear
Source§impl<K: Eq + Hash, V, H: BuildHasher + Default, const I: usize> AutoMap<K, V, H, I>
impl<K: Eq + Hash, V, H: BuildHasher + Default, const I: usize> AutoMap<K, V, H, I>
Sourcepub fn insert(&mut self, key: K, value: V) -> Option<V>
pub fn insert(&mut self, key: K, value: V) -> Option<V>
see HashMap::insert
Sourcepub fn remove(&mut self, key: &K) -> Option<V>
pub fn remove(&mut self, key: &K) -> Option<V>
see HashMap::remove
Sourcepub fn extend(&mut self, iter: impl IntoIterator<Item = (K, V)>)
pub fn extend(&mut self, iter: impl IntoIterator<Item = (K, V)>)
see HashMap::extend
Sourcepub fn entry(&mut self, key: K) -> Entry<'_, K, V, H, I>
pub fn entry(&mut self, key: K) -> Entry<'_, K, V, H, I>
see HashMap::entry
pub fn raw_entry_mut<Q>(&mut self, key: &Q) -> RawEntry<'_, K, V, H, I>
pub fn extract_if<'l, F>(&'l mut self, f: F) -> ExtractIfIter<'l, K, V, I, F> ⓘ
Sourcepub fn shrink_to_fit(&mut self)
pub fn shrink_to_fit(&mut self)
pub fn shrink_amortized(&mut self)
Source§impl<K, V, H, const I: usize> AutoMap<K, V, H, I>
impl<K, V, H, const I: usize> AutoMap<K, V, H, I>
Sourcepub fn iter(&self) -> Iter<'_, K, V> ⓘ
pub fn iter(&self) -> Iter<'_, K, V> ⓘ
see HashMap::iter
Sourcepub fn len(&self) -> usize
pub fn len(&self) -> usize
see HashMap::len
Sourcepub fn values_mut(&mut self) -> ValuesMut<'_, K, V> ⓘ
pub fn values_mut(&mut self) -> ValuesMut<'_, K, V> ⓘ
Sourcepub fn values(&self) -> Values<'_, K, V> ⓘ
pub fn values(&self) -> Values<'_, K, V> ⓘ
see HashMap::values
Sourcepub fn into_values(self) -> IntoValues<K, V, I> ⓘ
pub fn into_values(self) -> IntoValues<K, V, I> ⓘ
Trait Implementations§
Source§impl<'de, K, V, H, const I: usize> Deserialize<'de> for AutoMap<K, V, H, I>
impl<'de, K, V, H, const I: usize> Deserialize<'de> for AutoMap<K, V, H, I>
Source§fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl<'a, K, V, H, const I: usize> IntoIterator for &'a AutoMap<K, V, H, I>
impl<'a, K, V, H, const I: usize> IntoIterator for &'a AutoMap<K, V, H, I>
Source§impl<K, V, H, const I: usize> IntoIterator for AutoMap<K, V, H, I>
impl<K, V, H, const I: usize> IntoIterator for AutoMap<K, V, H, I>
Source§impl<K, V, H, const I: usize> ShrinkToFit for AutoMap<K, V, H, I>
impl<K, V, H, const I: usize> ShrinkToFit for AutoMap<K, V, H, I>
fn shrink_to_fit(&mut self)
impl<K, V, H: BuildHasher, const I: usize> Eq for AutoMap<K, V, H, I>
Auto Trait Implementations§
impl<K, V, H, const I: usize> Freeze for AutoMap<K, V, H, I>
impl<K, V, H, const I: usize> RefUnwindSafe for AutoMap<K, V, H, I>
impl<K, V, H, const I: usize> Send for AutoMap<K, V, H, I>
impl<K, V, H, const I: usize> Sync for AutoMap<K, V, H, I>
impl<K, V, H, const I: usize> Unpin for AutoMap<K, V, H, I>
impl<K, V, H, const I: usize> UnwindSafe for AutoMap<K, V, H, I>
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.