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

source

pub fn new( generic_params: &[GenericParam], generic_args: &[GenericArgumentId] ) -> Self

source

pub fn concat(self, other: GenericSubstitution) -> Self

Methods from Deref<Target = OrderedHashMap<GenericParamId, GenericArgumentId>>§

source

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).

source

pub fn iter(&self) -> Iter<'_, Key, Value>

Returns an iterator over the key-value pairs of the map, in their order.

source

pub fn keys(&self) -> Keys<'_, Key, Value>

Returns an iterator over the keys of the map, in their order.

source

pub fn values(&self) -> Values<'_, Key, Value>

Returns an iterator over the values of the map, in their order.

source

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.

source

pub fn len(&self) -> usize

Returns the number of key-value pairs in the map.

source

pub fn is_empty(&self) -> bool

Returns true if the map contains no elements.

Trait Implementations§

source§

impl Clone for GenericSubstitution

source§

fn clone(&self) -> GenericSubstitution

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for GenericSubstitution

source§

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

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

impl Default for GenericSubstitution

source§

fn default() -> GenericSubstitution

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

impl Deref for GenericSubstitution

§

type Target = OrderedHashMap<GenericParamId, GenericArgumentId>

The resulting type after dereferencing.
source§

fn deref(&self) -> &Self::Target

Dereferences the value.
source§

impl Hash for GenericSubstitution

source§

fn hash<H: Hasher>(&self, state: &mut H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl PartialEq for GenericSubstitution

source§

fn eq(&self, other: &GenericSubstitution) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Eq for GenericSubstitution

source§

impl StructuralEq for GenericSubstitution

source§

impl StructuralPartialEq for GenericSubstitution

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> DynClone for Twhere T: Clone,

source§

fn __clone_box(&self, _: Private) -> *mut ()

source§

impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

source§

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,

§

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,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere 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<T0, T1, E, TRewriter> SemanticRewriter<(T0, T1), E> for TRewriterwhere TRewriter: SemanticRewriter<T0, E> + SemanticRewriter<T1, E>,

source§

fn rewrite(&mut self, value: (T0, T1)) -> Result<(T0, T1), E>

source§

impl<T, E, TRewriter> SemanticRewriter<Box<T>, E> for TRewriterwhere T: Clone, TRewriter: SemanticRewriter<T, E>,

source§

fn rewrite(&mut self, value: Box<T>) -> Result<Box<T>, E>

source§

impl<T, E, TRewriter> SemanticRewriter<Option<T>, E> for TRewriterwhere TRewriter: SemanticRewriter<T, E>,

source§

fn rewrite(&mut self, value: Option<T>) -> Result<Option<T>, E>

source§

impl<T, E, TRewriter, E2> SemanticRewriter<Result<T, E2>, E> for TRewriterwhere TRewriter: SemanticRewriter<T, E>,

source§

fn rewrite(&mut self, value: Result<T, E2>) -> Result<Result<T, E2>, E>

source§

impl<T, E, TRewriter> SemanticRewriter<Vec<T>, E> for TRewriterwhere TRewriter: SemanticRewriter<T, E>,

source§

fn rewrite(&mut self, value: Vec<T>) -> Result<Vec<T>, E>

source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

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 Twhere U: TryFrom<T>,

§

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.
source§

impl<T> Upcast<T> for Twhere T: ?Sized,

source§

fn upcast(&self) -> &T

source§

impl<T> UpcastMut<T> for Twhere T: ?Sized,

source§

fn upcast_mut(&mut self) -> &mut T