Struct miri::borrow_tracker::tree_borrows::unimap::UniValMap
source · pub struct UniValMap<V> {
data: Vec<Option<V>>,
}
Expand description
From UniIndex to V
Fields§
§data: Vec<Option<V>>
The mapping data. Thanks to Vec we get both fast accesses, and a memory-optimal representation if there are few deletions.
Implementations§
source§impl<V: PartialEq> UniValMap<V>
impl<V: PartialEq> UniValMap<V>
sourcepub fn identical(&self, other: &Self) -> bool
pub fn identical(&self, other: &Self) -> bool
Exact equality of two maps.
Less accurate but faster than equivalent
, mostly because
of the fast path when the lengths are different.
sourcepub fn equivalent(&self, other: &Self) -> bool
pub fn equivalent(&self, other: &Self) -> bool
Equality up to trailing None
s of two maps, i.e.
do they represent the same mapping ?
source§impl<V> UniValMap<V>
impl<V> UniValMap<V>
sourcepub fn contains_idx(&self, idx: UniIndex) -> bool
pub fn contains_idx(&self, idx: UniIndex) -> bool
Whether this index has an associated value.
sourcefn extend_to_length(&mut self, len: usize)
fn extend_to_length(&mut self, len: usize)
Reserve enough space to insert the value at the right index.
sourcepub fn insert(&mut self, idx: UniIndex, val: V)
pub fn insert(&mut self, idx: UniIndex, val: V)
Assign a value to the index. Permanently overwrites any previous value.
Trait Implementations§
source§impl<V: PartialEq> PartialEq<UniValMap<V>> for UniValMap<V>
impl<V: PartialEq> PartialEq<UniValMap<V>> for UniValMap<V>
impl<V: Eq> Eq for UniValMap<V>
impl<V> StructuralEq for UniValMap<V>
Auto Trait Implementations§
impl<V> RefUnwindSafe for UniValMap<V>where V: RefUnwindSafe,
impl<V> Send for UniValMap<V>where V: Send,
impl<V> Sync for UniValMap<V>where V: Sync,
impl<V> Unpin for UniValMap<V>where V: Unpin,
impl<V> UnwindSafe for UniValMap<V>where V: 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
Layout§
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...)
attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.
Size: 24 bytes