Skip to main content

SymHashMap

Struct SymHashMap 

Source
pub struct SymHashMap<T>(pub FxHashMap<SymStr, T>);
Expand description

A convenience abstraction over a String-keyed HashMap

typically used for HashMap<String,Stored> states. The goal is to support both a string interface, as well as the interned tickets interface, while avoiding String allocations internally.

Tuple Fields§

§0: FxHashMap<SymStr, T>

Implementations§

Source§

impl<T> SymHashMap<T>

Source

pub fn len(&self) -> usize

Source

pub fn is_empty(&self) -> bool

Source

pub fn get(&self, key: &str) -> Option<&T>

Source

pub fn get_sym(&self, key: SymStr) -> Option<&T>

Source

pub fn get_mut(&mut self, key: &str) -> Option<&mut T>

Source

pub fn get_mut_sym(&mut self, key: SymStr) -> Option<&mut T>

Source

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

Source

pub fn contains_key_sym(&self, key: &SymStr) -> bool

Source

pub fn insert(&mut self, key: &str, value: T)

Source

pub fn insert_sym(&mut self, key: SymStr, value: T)

Source

pub fn remove(&mut self, key: &str)

Source

pub fn remove_sym(&mut self, key: SymStr)

Source

pub fn keys(&self) -> Keys<'_, SymStr, T>

Source

pub fn entry(&mut self, key: &str) -> Entry<'_, SymStr, T>

Source

pub fn entry_sym(&mut self, key: SymStr) -> Entry<'_, SymStr, T>

Source

pub fn iter(&self) -> Iter<'_, SymStr, T>

Trait Implementations§

Source§

impl<T: Clone> Clone for SymHashMap<T>

Source§

fn clone(&self) -> SymHashMap<T>

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl<T: Debug> Debug for SymHashMap<T>

Source§

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

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

impl<T> Default for SymHashMap<T>

Source§

fn default() -> Self

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

impl From<SymHashMap<Stored>> for Stored

Source§

fn from(value: SymHashMap<Stored>) -> Self

Converts to this type from the input type.
Source§

impl<T> Index<&SymbolU32> for SymHashMap<T>

Source§

fn index(&self, key: &SymStr) -> &T

Returns a reference to the value corresponding to the supplied key.

§Panics

Panics if the key is not present in the HashMap.

Source§

type Output = T

The returned type after indexing.
Source§

impl<'a, T> IntoIterator for &'a SymHashMap<T>

Source§

type Item = (&'a SymbolU32, &'a T)

The type of the elements being iterated over.
Source§

type IntoIter = Iter<'a, SymbolU32, T>

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

fn into_iter(self) -> Iter<'a, SymStr, T>

Creates an iterator from a value. Read more
Source§

impl<'a, T> IntoIterator for &'a mut SymHashMap<T>

Source§

type Item = (&'a SymbolU32, &'a mut T)

The type of the elements being iterated over.
Source§

type IntoIter = IterMut<'a, SymbolU32, T>

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

fn into_iter(self) -> IterMut<'a, SymStr, T>

Creates an iterator from a value. Read more
Source§

impl<T> IntoIterator for SymHashMap<T>

Source§

type Item = (SymbolU32, T)

The type of the elements being iterated over.
Source§

type IntoIter = IntoIter<SymbolU32, T>

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 IntoPropertiesResult for SymHashMap<Stored>

Auto Trait Implementations§

§

impl<T> Freeze for SymHashMap<T>

§

impl<T> RefUnwindSafe for SymHashMap<T>
where T: RefUnwindSafe,

§

impl<T> Send for SymHashMap<T>
where T: Send,

§

impl<T> Sync for SymHashMap<T>
where T: Sync,

§

impl<T> Unpin for SymHashMap<T>
where T: Unpin,

§

impl<T> UnsafeUnpin for SymHashMap<T>

§

impl<T> UnwindSafe for SymHashMap<T>
where T: UnwindSafe,

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