ObjectMap

Struct ObjectMap 

Source
pub struct ObjectMap<K, S = RandomState> { /* private fields */ }

Implementations§

Source§

impl<K, S> ObjectMap<K, S>

Source

pub fn keys(&self) -> Keys<'_, K, *mut c_void>

Source

pub fn len(&self) -> usize

Source

pub fn capacity(&self) -> usize

Source

pub fn is_empty(&self) -> bool

Source

pub fn clear(&mut self)

Source

pub fn hasher(&mut self) -> &S

Source§

impl<K> ObjectMap<K, RandomState>

Source

pub fn new() -> Self

Source

pub fn with_capacity(capacity: usize) -> Self

Source§

impl<K, S> ObjectMap<K, S>
where K: Eq + Hash, S: BuildHasher,

Source

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

Source

pub fn insert<V>(&mut self, k: K, v: V) -> Option<*mut c_void>

Source

pub fn insert_raw(&mut self, k: K, ptr: *mut c_void) -> Option<*mut c_void>

Source

pub fn remove<Q>(&mut self, k: &Q) -> Option<*mut c_void>
where K: Borrow<Q>, Q: Hash + Eq + ?Sized,

Source

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

Source

pub fn get_mut<Q, T>(&mut self, k: &Q) -> Option<&mut T>
where K: Borrow<Q>, Q: Hash + Eq + ?Sized,

Source

pub fn contains_key<Q>(&self, k: &Q) -> bool
where K: Borrow<Q>, Q: Hash + Eq + ?Sized,

Trait Implementations§

Source§

impl<K: Debug, S: Debug> Debug for ObjectMap<K, S>

Source§

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

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

impl<K> Default for ObjectMap<K, RandomState>

Source§

fn default() -> Self

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

impl<K, S> IntoIterator for ObjectMap<K, S>

Source§

type Item = (K, *mut c_void)

The type of the elements being iterated over.
Source§

type IntoIter = IntoIter<K, *mut c_void>

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

fn into_iter(self) -> IntoIter<K, *mut c_void>

Creates an iterator from a value. Read more

Auto Trait Implementations§

§

impl<K, S> Freeze for ObjectMap<K, S>
where S: Freeze,

§

impl<K, S> RefUnwindSafe for ObjectMap<K, S>

§

impl<K, S = RandomState> !Send for ObjectMap<K, S>

§

impl<K, S = RandomState> !Sync for ObjectMap<K, S>

§

impl<K, S> Unpin for ObjectMap<K, S>
where S: Unpin, K: Unpin,

§

impl<K, S> UnwindSafe for ObjectMap<K, S>
where K: UnwindSafe, S: 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.