pub enum SubtypeResult {
True,
False,
CycleDetected,
DepthExceeded,
}Expand description
Result of a subtype check
Variants§
True
The relationship is definitely true
False
The relationship is definitely false
CycleDetected
We’re in a valid cycle (coinductive recursion)
This represents finite/cyclic recursion like interface List { next: List }.
The type graph forms a closed loop, which is valid in TypeScript.
DepthExceeded
We’ve exceeded the recursion depth limit
This represents expansive recursion that grows indefinitely like
type T<X> = T<Box<X>>. TypeScript rejects these as “excessively deep”.
This is treated as false for soundness - if we can’t prove subtyping within
reasonable limits, we reject the relationship rather than accepting unsoundly.
Implementations§
Trait Implementations§
Source§impl Clone for SubtypeResult
impl Clone for SubtypeResult
Source§fn clone(&self) -> SubtypeResult
fn clone(&self) -> SubtypeResult
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 SubtypeResult
impl Debug for SubtypeResult
Source§impl PartialEq for SubtypeResult
impl PartialEq for SubtypeResult
impl Copy for SubtypeResult
impl Eq for SubtypeResult
impl StructuralPartialEq for SubtypeResult
Auto Trait Implementations§
impl Freeze for SubtypeResult
impl RefUnwindSafe for SubtypeResult
impl Send for SubtypeResult
impl Sync for SubtypeResult
impl Unpin for SubtypeResult
impl UnsafeUnpin for SubtypeResult
impl UnwindSafe for SubtypeResult
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.