pub struct TypeTable { /* private fields */ }Implementations§
Source§impl TypeTable
impl TypeTable
pub fn new() -> Self
pub fn get(&self, id: ExprId) -> &InferredType
pub fn get_opt(&self, id: ExprId) -> Option<&InferredType>
pub fn set(&mut self, id: ExprId, ty: InferredType)
Sourcepub fn snapshot(&self) -> Vec<(ExprId, InferredType)>
pub fn snapshot(&self) -> Vec<(ExprId, InferredType)>
Returns a snapshot of all types. The snapshot is a Vec ordered by
insertion — used for fix-point convergence checks (O(n) clone of
InferredType values, not a tree clone).
Sourcepub fn same_as(&self, other: &TypeTable) -> bool
pub fn same_as(&self, other: &TypeTable) -> bool
Returns true if this TypeTable has the same types as other.
Used to detect convergence in the fix-point loop.
Sourcepub fn same_as_snapshot(&self, snapshot: &[(ExprId, InferredType)]) -> bool
pub fn same_as_snapshot(&self, snapshot: &[(ExprId, InferredType)]) -> bool
Returns true if the current state matches a previously taken snapshot.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for TypeTable
impl RefUnwindSafe for TypeTable
impl Send for TypeTable
impl Sync for TypeTable
impl Unpin for TypeTable
impl UnsafeUnpin for TypeTable
impl UnwindSafe for TypeTable
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