NameTable

Struct NameTable 

Source
pub struct NameTable<T> { /* private fields */ }

Implementations§

Source§

impl<T> NameTable<T>

Source

pub fn new() -> Self

Source

pub fn with_capacity(capacity: usize) -> Self

Source

pub fn replace_at( &mut self, index: NonZeroUsize, new_value: T, ) -> Result<(), ()>

Source

pub fn replace_by_hash(&mut self, hash: u64, new_value: T) -> Result<(), ()>

Source

pub fn raw_insert( &mut self, hash: u64, entry: NameTableEntry<T>, ) -> NonZeroUsize

Source

pub fn insert(&mut self, entry: NameTableEntry<T>) -> NonZeroUsize

Source

pub fn get_hash_at(&self, index: NonZeroUsize) -> Option<&u64>

Source

pub fn get_at(&self, index: NonZeroUsize) -> Option<&NameTableEntry<T>>

Source

pub fn get_at_mut( &mut self, index: NonZeroUsize, ) -> Option<&mut NameTableEntry<T>>

Source

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

Source

pub fn get_by_hash(&self, hash: u64) -> Option<&NameTableEntry<T>>

Source

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

Source

pub fn get_mut_by_hash(&mut self, hash: u64) -> Option<&mut NameTableEntry<T>>

Source

pub fn position(&self, name: &str) -> Option<NonZeroUsize>

Source

pub fn position_by_hash(&self, hash: u64) -> Option<NonZeroUsize>

Source

pub fn contains(&self, name: &str) -> bool

Source

pub fn contains_hash(&self, hash: u64) -> bool

Source

pub fn entries(&self) -> Iter<'_, NameTableEntry<T>>

Source

pub fn entries_mut(&mut self) -> IterMut<'_, NameTableEntry<T>>

Source

pub fn drain(&mut self) -> Vec<NameTableEntry<T>>

Trait Implementations§

Source§

impl<T: Debug> Debug for NameTable<T>

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<T> Freeze for NameTable<T>

§

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

§

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

§

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

§

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

§

impl<T> UnwindSafe for NameTable<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> 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, 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.