pub struct TypeSubstitution { /* private fields */ }Expand description
A substitution map from type parameter names to concrete types.
Implementations§
Source§impl TypeSubstitution
impl TypeSubstitution
Sourcepub fn from_args(
interner: &dyn TypeDatabase,
type_params: &[TypeParamInfo],
type_args: &[TypeId],
) -> Self
pub fn from_args( interner: &dyn TypeDatabase, type_params: &[TypeParamInfo], type_args: &[TypeId], ) -> Self
Create a substitution from type parameters and arguments.
type_params - The declared type parameters (e.g., <T, U>)
type_args - The provided type arguments (e.g., <string, number>)
When type_args has fewer elements than type_params, default values
from the type parameters are used for the remaining parameters.
IMPORTANT: Defaults may reference earlier type parameters, so they need to be instantiated with the substitution built so far.
Trait Implementations§
Source§impl Clone for TypeSubstitution
impl Clone for TypeSubstitution
Source§fn clone(&self) -> TypeSubstitution
fn clone(&self) -> TypeSubstitution
Returns a duplicate 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 TypeSubstitution
impl Debug for TypeSubstitution
Source§impl Default for TypeSubstitution
impl Default for TypeSubstitution
Source§fn default() -> TypeSubstitution
fn default() -> TypeSubstitution
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for TypeSubstitution
impl RefUnwindSafe for TypeSubstitution
impl Send for TypeSubstitution
impl Sync for TypeSubstitution
impl Unpin for TypeSubstitution
impl UnsafeUnpin for TypeSubstitution
impl UnwindSafe for TypeSubstitution
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