pub struct InferenceContext { /* private fields */ }Expand description
Type inference context
Implementations§
Source§impl InferenceContext
impl InferenceContext
Sourcepub fn fresh_type_var(&mut self) -> Type
pub fn fresh_type_var(&mut self) -> Type
Create a fresh type variable
Sourcepub fn bind_variable(&mut self, name: String, typ: Type)
pub fn bind_variable(&mut self, name: String, typ: Type)
Add a variable binding
Sourcepub fn lookup_variable(&self, name: &str) -> Option<&Type>
pub fn lookup_variable(&self, name: &str) -> Option<&Type>
Look up a variable’s type
Sourcepub fn apply_substitutions(&self, typ: &Type) -> Type
pub fn apply_substitutions(&self, typ: &Type) -> Type
Apply substitutions to a type
Trait Implementations§
Auto Trait Implementations§
impl Freeze for InferenceContext
impl RefUnwindSafe for InferenceContext
impl Send for InferenceContext
impl Sync for InferenceContext
impl Unpin for InferenceContext
impl UnwindSafe for InferenceContext
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