pub struct GenericSubstitution(pub OrderedHashMap<GenericParamId, GenericArgumentId>);
Expand description
A substitution of generic arguments in generic parameters. Used for concretization.
Tuple Fields§
§0: OrderedHashMap<GenericParamId, GenericArgumentId>
Implementations§
source§impl GenericSubstitution
impl GenericSubstitution
pub fn new( generic_params: &[GenericParam], generic_args: &[GenericArgumentId] ) -> Self
pub fn concat(self, other: GenericSubstitution) -> Self
Methods from Deref<Target = OrderedHashMap<GenericParamId, GenericArgumentId>>§
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 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 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.
Trait Implementations§
source§impl Clone for GenericSubstitution
impl Clone for GenericSubstitution
source§fn clone(&self) -> GenericSubstitution
fn clone(&self) -> GenericSubstitution
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for GenericSubstitution
impl Debug for GenericSubstitution
source§impl Default for GenericSubstitution
impl Default for GenericSubstitution
source§fn default() -> GenericSubstitution
fn default() -> GenericSubstitution
Returns the “default value” for a type. Read more
source§impl Deref for GenericSubstitution
impl Deref for GenericSubstitution
§type Target = OrderedHashMap<GenericParamId, GenericArgumentId>
type Target = OrderedHashMap<GenericParamId, GenericArgumentId>
The resulting type after dereferencing.
source§impl Hash for GenericSubstitution
impl Hash for GenericSubstitution
source§impl PartialEq for GenericSubstitution
impl PartialEq for GenericSubstitution
source§fn eq(&self, other: &GenericSubstitution) -> bool
fn eq(&self, other: &GenericSubstitution) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.impl Eq for GenericSubstitution
impl StructuralEq for GenericSubstitution
impl StructuralPartialEq for GenericSubstitution
Auto Trait Implementations§
impl RefUnwindSafe for GenericSubstitution
impl Send for GenericSubstitution
impl Sync for GenericSubstitution
impl Unpin for GenericSubstitution
impl UnwindSafe for GenericSubstitution
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
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
Compare self to
key
and return true
if they are equal.§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,
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§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,
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.