pub struct RelationCacheKey {
pub source: TypeId,
pub target: TypeId,
pub relation: u8,
pub flags: u16,
pub any_mode: u8,
}Expand description
Cache key for type relation queries (subtype, assignability, etc.).
This key includes Lawyer-layer configuration flags to ensure that results computed under different rules (strict vs non-strict) don’t contaminate each other.
§Fields
source: The source type being comparedtarget: The target type being comparedrelation: Distinguishes between different relation types (0 = subtype, 1 = assignability, etc.)flags: Bitmask for boolean compiler options (u16 to support current and future flags):- bit 0:
strict_null_checks - bit 1:
strict_function_types - bit 2:
exact_optional_property_types - bit 3:
no_unchecked_indexed_access - bit 4:
disable_method_bivariance(Sound Mode) - bit 5:
allow_void_return - bit 6:
allow_bivariant_rest - bit 7:
allow_bivariant_param_count - bits 8-15: Reserved for future flags (
strict_any_propagation,strict_structural_checking, etc.)
- bit 0:
any_mode: Controls howanyis treated (0 = All, 1 =TopLevelOnly)
Fields§
§source: TypeId§target: TypeId§relation: u8§flags: u16§any_mode: u8Implementations§
Source§impl RelationCacheKey
impl RelationCacheKey
pub const ASSIGNABLE: u8 = 1
pub const IDENTICAL: u8 = 2
pub const FLAG_STRICT_NULL_CHECKS: u16
pub const FLAG_STRICT_FUNCTION_TYPES: u16
pub const FLAG_EXACT_OPTIONAL_PROPERTY_TYPES: u16
pub const FLAG_NO_UNCHECKED_INDEXED_ACCESS: u16
pub const FLAG_DISABLE_METHOD_BIVARIANCE: u16
pub const FLAG_ALLOW_VOID_RETURN: u16
pub const FLAG_ALLOW_BIVARIANT_REST: u16
pub const FLAG_ALLOW_BIVARIANT_PARAM_COUNT: u16
Trait Implementations§
Source§impl Clone for RelationCacheKey
impl Clone for RelationCacheKey
Source§fn clone(&self) -> RelationCacheKey
fn clone(&self) -> RelationCacheKey
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 RelationCacheKey
impl Debug for RelationCacheKey
Source§impl Hash for RelationCacheKey
impl Hash for RelationCacheKey
Source§impl PartialEq for RelationCacheKey
impl PartialEq for RelationCacheKey
impl Copy for RelationCacheKey
impl Eq for RelationCacheKey
impl StructuralPartialEq for RelationCacheKey
Auto Trait Implementations§
impl Freeze for RelationCacheKey
impl RefUnwindSafe for RelationCacheKey
impl Send for RelationCacheKey
impl Sync for RelationCacheKey
impl Unpin for RelationCacheKey
impl UnsafeUnpin for RelationCacheKey
impl UnwindSafe for RelationCacheKey
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.