pub struct GradualTyper;Expand description
A gradual type checker that produces evidence for coercions.
Implementations§
Source§impl GradualTyper
impl GradualTyper
Sourcepub fn consistent(
a: &GradualType,
b: &GradualType,
) -> Option<ConsistencyEvidence>
pub fn consistent( a: &GradualType, b: &GradualType, ) -> Option<ConsistencyEvidence>
Check whether two gradual types are consistent and return evidence if so.
Sourcepub fn unknown_is_consistent_with_any(b: &GradualType) -> bool
pub fn unknown_is_consistent_with_any(b: &GradualType) -> bool
Check if the unknown type ? is consistent with any type (always true).
Sourcepub fn is_symmetric(a: &GradualType, b: &GradualType) -> bool
pub fn is_symmetric(a: &GradualType, b: &GradualType) -> bool
Verify the consistency relation is symmetric.
Sourcepub fn precision(a: &GradualType, b: &GradualType) -> bool
pub fn precision(a: &GradualType, b: &GradualType) -> bool
The precision order: A ⊑ B means A is “more precise” than B.
Int ⊑ ?, (Int → Bool) ⊑ (? → ?), etc.
Auto Trait Implementations§
impl Freeze for GradualTyper
impl RefUnwindSafe for GradualTyper
impl Send for GradualTyper
impl Sync for GradualTyper
impl Unpin for GradualTyper
impl UnsafeUnpin for GradualTyper
impl UnwindSafe for GradualTyper
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