pub struct Subst { /* private fields */ }Expand description
A substitution mapping type variables to types.
Implementations§
Source§impl Subst
impl Subst
Sourcepub fn insert(&mut self, var: &TyVar, ty: Ty)
pub fn insert(&mut self, var: &TyVar, ty: Ty)
Inserts a mapping from a type variable to a type.
Sourcepub fn contains(&self, var: &TyVar) -> bool
pub fn contains(&self, var: &TyVar) -> bool
Checks if a type variable has a mapping in this substitution.
Sourcepub fn apply_ty_list(&self, l: &TyList) -> TyList
pub fn apply_ty_list(&self, l: &TyList) -> TyList
Applies this substitution to a type-level list.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Subst
impl<'de> Deserialize<'de> for Subst
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for Subst
impl RefUnwindSafe for Subst
impl Send for Subst
impl Sync for Subst
impl Unpin for Subst
impl UnsafeUnpin for Subst
impl UnwindSafe for Subst
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