Enum AutoMap

Source
pub enum AutoMap<K, V, H = BuildHasherDefault<FxHasher>, const I: usize = 0> {
    List(SmallVec<[(K, V); I]>),
    Map(Box<HashMap<K, V, H>>),
}

Variants§

§

List(SmallVec<[(K, V); I]>)

§

Map(Box<HashMap<K, V, H>>)

Implementations§

Source§

impl<K, V> AutoMap<K, V, BuildHasherDefault<FxHasher>, 0>

Source

pub const fn new() -> Self

Source

pub fn with_capacity(capacity: usize) -> Self

Source§

impl<K, V, H: BuildHasher, const I: usize> AutoMap<K, V, H, I>

Source

pub const fn with_hasher() -> Self

Source

pub fn with_capacity_and_hasher(capacity: usize, hasher: H) -> Self

Source

pub fn clear(&mut self)

Source§

impl<K: Eq + Hash, V, H: BuildHasher + Default, const I: usize> AutoMap<K, V, H, I>

Source

pub fn insert(&mut self, key: K, value: V) -> Option<V>

Source

pub fn remove(&mut self, key: &K) -> Option<V>

Source

pub fn extend(&mut self, iter: impl IntoIterator<Item = (K, V)>)

Source

pub fn entry(&mut self, key: K) -> Entry<'_, K, V, H, I>

Source

pub fn raw_entry_mut<Q>(&mut self, key: &Q) -> RawEntry<'_, K, V, H, I>
where K: Borrow<Q>, Q: Hash + Eq + ?Sized,

Source

pub fn retain<F>(&mut self, f: F)
where F: FnMut(&K, &mut V) -> bool,

Source

pub fn extract_if<'l, F>(&'l mut self, f: F) -> ExtractIfIter<'l, K, V, I, F>
where F: for<'a, 'b> FnMut(&'a K, &'b mut V) -> bool,

Source

pub fn shrink_to_fit(&mut self)

Source

pub fn shrink_amortized(&mut self)

Source§

impl<K: Eq + Hash, V, H: BuildHasher, const I: usize> AutoMap<K, V, H, I>

Source

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

Source

pub fn get_mut(&mut self, key: &K) -> Option<&mut V>

Source

pub fn contains_key(&self, key: &K) -> bool

Source§

impl<K, V, H, const I: usize> AutoMap<K, V, H, I>

Source

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

Source

pub fn iter_mut(&mut self) -> IterMut<'_, K, V>

Source

pub fn is_empty(&self) -> bool

Source

pub fn len(&self) -> usize

Source

pub fn values_mut(&mut self) -> ValuesMut<'_, K, V>

Source

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

Source

pub fn into_values(self) -> IntoValues<K, V, I>

Trait Implementations§

Source§

impl<K: Clone, V: Clone, H: Clone, const I: usize> Clone for AutoMap<K, V, H, I>

Source§

fn clone(&self) -> AutoMap<K, V, H, I>

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<K: Debug, V: Debug, H, const I: usize> Debug for AutoMap<K, V, H, I>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<K, V, H, const I: usize> Default for AutoMap<K, V, H, I>

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<'de, K, V, H, const I: usize> Deserialize<'de> for AutoMap<K, V, H, I>
where K: Eq + Hash + Deserialize<'de>, V: Deserialize<'de>, H: BuildHasher + Default,

Source§

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<K, V, H, const I: usize> FromIterator<(K, V)> for AutoMap<K, V, H, I>
where K: Eq + Hash, H: BuildHasher + Default,

Source§

fn from_iter<T: IntoIterator<Item = (K, V)>>(iter: T) -> Self

Creates a value from an iterator. Read more
Source§

impl<'a, K, V, H, const I: usize> IntoIterator for &'a AutoMap<K, V, H, I>

Source§

type Item = (&'a K, &'a V)

The type of the elements being iterated over.
Source§

type IntoIter = Iter<'a, K, V>

Which kind of iterator are we turning this into?
Source§

fn into_iter(self) -> Self::IntoIter

Creates an iterator from a value. Read more
Source§

impl<K, V, H, const I: usize> IntoIterator for AutoMap<K, V, H, I>

Source§

type Item = (K, V)

The type of the elements being iterated over.
Source§

type IntoIter = IntoIter<K, V, I>

Which kind of iterator are we turning this into?
Source§

fn into_iter(self) -> Self::IntoIter

Creates an iterator from a value. Read more
Source§

impl<K: Eq + Hash, V: Eq, H: BuildHasher, const I: usize> PartialEq for AutoMap<K, V, H, I>

Source§

fn eq(&self, other: &Self) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<K, V, H, const I: usize> Serialize for AutoMap<K, V, H, I>
where K: Eq + Hash + Serialize, V: Serialize, H: BuildHasher,

Source§

fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl<K, V, H, const I: usize> ShrinkToFit for AutoMap<K, V, H, I>
where K: Eq + Hash, V: Eq, H: BuildHasher + Default,

Source§

fn shrink_to_fit(&mut self)

Source§

impl<K, V, H: BuildHasher, const I: usize> Eq for AutoMap<K, V, H, I>
where K: Eq + Hash, V: Eq,

Auto Trait Implementations§

§

impl<K, V, H, const I: usize> Freeze for AutoMap<K, V, H, I>
where K: Freeze, V: Freeze,

§

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>
where K: Send, V: Send, H: Send,

§

impl<K, V, H, const I: usize> Sync for AutoMap<K, V, H, I>
where H: Sync, K: Sync, V: Sync,

§

impl<K, V, H, const I: usize> Unpin for AutoMap<K, V, H, I>
where K: Unpin, V: Unpin,

§

impl<K, V, H, const I: usize> UnwindSafe for AutoMap<K, V, H, I>

Blanket Implementations§

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

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

Source§

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

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

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
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

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

Source§

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 T
where U: TryFrom<T>,

Source§

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.
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,