pub struct SecondaryMap<K, V>{ /* private fields */ }Expand description
Like cranelift_entity::SecondaryMap but all allocation is fallible.
Implementations§
Source§impl<K, V> SecondaryMap<K, V>
impl<K, V> SecondaryMap<K, V>
Sourcepub fn new() -> Selfwhere
V: Default,
pub fn new() -> Selfwhere
V: Default,
Same as cranelift_entity::SecondaryMap::new.
Sourcepub fn with_capacity(capacity: usize) -> Result<Self, OutOfMemory>where
V: Default,
pub fn with_capacity(capacity: usize) -> Result<Self, OutOfMemory>where
V: Default,
Sourcepub fn with_default(default: V) -> Self
pub fn with_default(default: V) -> Self
Sourcepub fn get(&self, k: K) -> Option<&V>
pub fn get(&self, k: K) -> Option<&V>
Same as cranelift_entity::SecondaryMap::get.
Sourcepub fn insert(&mut self, k: K, v: V) -> Result<Option<V>, OutOfMemory>
pub fn insert(&mut self, k: K, v: V) -> Result<Option<V>, OutOfMemory>
Sourcepub fn iter(&self) -> Iter<'_, K, V> ⓘ
pub fn iter(&self) -> Iter<'_, K, V> ⓘ
Same as cranelift_entity::SecondaryMap::iter.
Sourcepub fn keys(&self) -> Keys<K> ⓘ
pub fn keys(&self) -> Keys<K> ⓘ
Same as cranelift_entity::SecondaryMap::keys.
Sourcepub fn values_mut(&mut self) -> IterMut<'_, V> ⓘ
pub fn values_mut(&mut self) -> IterMut<'_, V> ⓘ
Trait Implementations§
Source§impl<K, V> Debug for SecondaryMap<K, V>
impl<K, V> Debug for SecondaryMap<K, V>
Source§impl<K, V> Default for SecondaryMap<K, V>
impl<K, V> Default for SecondaryMap<K, V>
Source§fn default() -> SecondaryMap<K, V>
fn default() -> SecondaryMap<K, V>
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl<K, V> Freeze for SecondaryMap<K, V>where
V: Freeze,
impl<K, V> RefUnwindSafe for SecondaryMap<K, V>where
V: RefUnwindSafe,
K: RefUnwindSafe,
impl<K, V> Send for SecondaryMap<K, V>
impl<K, V> Sync for SecondaryMap<K, V>
impl<K, V> Unpin for SecondaryMap<K, V>
impl<K, V> UnwindSafe for SecondaryMap<K, V>where
V: UnwindSafe,
K: UnwindSafe,
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