Struct cairo_lang_lowering::objects::VarRemapping
source · pub struct VarRemapping {
pub remapping: OrderedHashMap<VariableId, VariableId>,
}
Expand description
Remapping of lowered variable ids. Useful for convergence of branches.
Fields§
§remapping: OrderedHashMap<VariableId, VariableId>
Map from new_var to old_var (since new_var cannot appear twice, but old_var can).
Methods from Deref<Target = OrderedHashMap<VariableId, VariableId>>§
sourcepub fn get<Q>(&self, key: &Q) -> Option<&Value>where
Q: Hash + Equivalent<Key> + ?Sized,
pub fn get<Q>(&self, key: &Q) -> Option<&Value>where Q: Hash + Equivalent<Key> + ?Sized,
Returns a reference to the value stored for key, if it is present, else None.
Computes in O(1) time (average).
sourcepub fn get_mut<Q>(&mut self, key: &Q) -> Option<&mut Value>where
Q: Hash + Equivalent<Key> + ?Sized,
pub fn get_mut<Q>(&mut self, key: &Q) -> Option<&mut Value>where Q: Hash + Equivalent<Key> + ?Sized,
Returns a mutable reference to the value stored for key, if it is present, else None.
Computes in O(1) time (average).
sourcepub fn entry(&mut self, key: Key) -> Entry<'_, Key, Value>
pub fn entry(&mut self, key: Key) -> Entry<'_, Key, Value>
Gets the given key’s corresponding entry in the map for insertion and/or in-place manipulation.
Computes in O(1) time (amortized average).
sourcepub fn iter(&self) -> Iter<'_, Key, Value>
pub fn iter(&self) -> Iter<'_, Key, Value>
Returns an iterator over the key-value pairs of the map, in their order.
sourcepub fn iter_mut(&mut self) -> IterMut<'_, Key, Value>
pub fn iter_mut(&mut self) -> IterMut<'_, Key, Value>
Returns a mutable iterator over the key-value pairs of the map, in their order.
sourcepub fn keys(&self) -> Keys<'_, Key, Value>
pub fn keys(&self) -> Keys<'_, Key, Value>
Returns an iterator over the keys of the map, in their order.
sourcepub fn values(&self) -> Values<'_, Key, Value>
pub fn values(&self) -> Values<'_, Key, Value>
Returns an iterator over the values of the map, in their order.
sourcepub fn insert(&mut self, key: Key, value: Value) -> Option<Value>
pub fn insert(&mut self, key: Key, value: Value) -> Option<Value>
Insert a key-value pair in the map.
If an equivalent key already exists in the map: the key remains and retains in its place in the order, its corresponding value is updated with value and the older value is returned inside Some(_).
If no equivalent key existed in the map: the new key-value pair is inserted, last in order, and None is returned.
Computes in O(1) time (amortized average).
See also entry if you you want to insert or modify or if you need to get the index of the corresponding key-value pair.
sourcepub fn extend<I>(&mut self, iter: I)where
I: IntoIterator<Item = (Key, Value)>,
pub fn extend<I>(&mut self, iter: I)where I: IntoIterator<Item = (Key, Value)>,
Extends the map with the content of the given iterator.
sourcepub fn contains_key<Q>(&self, key: &Q) -> boolwhere
Q: Hash + Equivalent<Key> + ?Sized,
pub fn contains_key<Q>(&self, key: &Q) -> boolwhere Q: Hash + Equivalent<Key> + ?Sized,
Returns true if an equivalent to key exists in the map.
sourcepub fn shift_remove<Q>(&mut self, key: &Q) -> Option<Value>where
Q: Hash + Equivalent<Key> + ?Sized,
pub fn shift_remove<Q>(&mut self, key: &Q) -> Option<Value>where Q: Hash + Equivalent<Key> + ?Sized,
Removes the entry for the given key, preserving the order of entries.
Returns the value associated with the key (if present).
sourcepub fn swap_remove<Q>(&mut self, key: &Q) -> Option<Value>where
Q: Hash + Equivalent<Key> + ?Sized,
pub fn swap_remove<Q>(&mut self, key: &Q) -> Option<Value>where Q: Hash + Equivalent<Key> + ?Sized,
Removes the entry for the given key by swapping it with the last element. Thus the order of elements is not preserved, but the resulting order is still deterministic.
Returns the value associated with the key (if present).
Trait Implementations§
source§impl Clone for VarRemapping
impl Clone for VarRemapping
source§fn clone(&self) -> VarRemapping
fn clone(&self) -> VarRemapping
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for VarRemapping
impl Debug for VarRemapping
source§impl DebugWithDb<LoweredFormatter<'_>> for VarRemapping
impl DebugWithDb<LoweredFormatter<'_>> for VarRemapping
source§impl Default for VarRemapping
impl Default for VarRemapping
source§fn default() -> VarRemapping
fn default() -> VarRemapping
source§impl Deref for VarRemapping
impl Deref for VarRemapping
source§impl DerefMut for VarRemapping
impl DerefMut for VarRemapping
source§impl PartialEq<VarRemapping> for VarRemapping
impl PartialEq<VarRemapping> for VarRemapping
source§fn eq(&self, other: &VarRemapping) -> bool
fn eq(&self, other: &VarRemapping) -> bool
self
and other
values to be equal, and is used
by ==
.impl Eq for VarRemapping
impl StructuralEq for VarRemapping
impl StructuralPartialEq for VarRemapping
Auto Trait Implementations§
impl RefUnwindSafe for VarRemapping
impl Send for VarRemapping
impl Sync for VarRemapping
impl Unpin for VarRemapping
impl UnwindSafe for VarRemapping
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
source§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.