Skip to main content

TypeInterner

Struct TypeInterner 

Source
pub struct TypeInterner {
    pub string_interner: ShardedInterner,
    /* private fields */
}
Expand description

Type interning table with lock-free concurrent access.

Uses sharded DashMap structures for all internal storage, enabling true parallel type checking without lock contention.

All internal structures use lazy initialization via OnceLock to minimize startup overhead - DashMaps are only allocated when first accessed.

Fields§

§string_interner: ShardedInterner

String interner for property names and string literals (already lock-free)

Implementations§

Source§

impl TypeInterner

Source

pub fn template_literal(&self, spans: Vec<TemplateSpan>) -> TypeId

Intern a template literal type

Source

pub fn template_literal_interpolation_positions( &self, type_id: TypeId, ) -> Vec<usize>

Get the interpolation positions from a template literal type Returns indices of type interpolation spans

Source

pub fn template_literal_get_span( &self, type_id: TypeId, index: usize, ) -> Option<TemplateSpan>

Get the span at a given position from a template literal type

Source

pub fn template_literal_span_count(&self, type_id: TypeId) -> usize

Get the number of spans in a template literal type

Source

pub fn template_literal_is_text_only(&self, type_id: TypeId) -> bool

Check if a template literal contains only text (no interpolations) Also returns true for string literals (which are the result of text-only template expansion)

Source§

impl TypeInterner

Source

pub fn new() -> Self

Create a new type interner with pre-registered intrinsics.

Uses lazy initialization for all DashMap structures to minimize startup overhead. DashMaps are only allocated when first accessed.

Source

pub fn set_array_base_type(&self, type_id: TypeId, params: Vec<TypeParamInfo>)

Set the global Array base type (e.g., Array from lib.d.ts).

This should be called once during primordial type setup when lib.d.ts is processed. Once set, the value cannot be changed (OnceLock enforces this).

Source

pub fn get_array_base_type(&self) -> Option<TypeId>

Get the global Array base type, if it has been set.

Source

pub fn get_array_base_type_params(&self) -> &[TypeParamInfo]

Get the type parameters for the global Array base type, if it has been set.

Source

pub fn set_boxed_type(&self, kind: IntrinsicKind, type_id: TypeId)

Set a boxed interface type for a primitive intrinsic kind.

Called during primordial type setup when lib.d.ts is processed. For example, set_boxed_type(IntrinsicKind::String, type_id_of_String_interface) enables property access on string values to resolve through the String interface.

Source

pub fn get_boxed_type(&self, kind: IntrinsicKind) -> Option<TypeId>

Get the boxed interface type for a primitive intrinsic kind.

Source

pub fn is_identity_comparable_type(&self, type_id: TypeId) -> bool

Check if a type can be compared by TypeId identity alone (O(1) equality). Results are cached for O(1) lookup after first computation. This is used for optimization in BCT and subtype checking.

Source

pub fn intern_string(&self, s: &str) -> Atom

Intern a string into an Atom. This is used when constructing types with property names or string literals.

Source

pub fn resolve_atom(&self, atom: Atom) -> String

Resolve an Atom back to its string value. This is used when formatting types for error messages.

Source

pub fn resolve_atom_ref(&self, atom: Atom) -> Arc<str>

Resolve an Atom without allocating a new String.

Source

pub fn type_list(&self, id: TypeListId) -> Arc<[TypeId]>

Source

pub fn tuple_list(&self, id: TupleListId) -> Arc<[TupleElement]>

Source

pub fn template_list(&self, id: TemplateLiteralId) -> Arc<[TemplateSpan]>

Source

pub fn object_shape(&self, id: ObjectShapeId) -> Arc<ObjectShape>

Source

pub fn object_property_index( &self, shape_id: ObjectShapeId, name: Atom, ) -> PropertyLookup

Source

pub fn function_shape(&self, id: FunctionShapeId) -> Arc<FunctionShape>

Source

pub fn callable_shape(&self, id: CallableShapeId) -> Arc<CallableShape>

Source

pub fn conditional_type(&self, id: ConditionalTypeId) -> Arc<ConditionalType>

Source

pub fn mapped_type(&self, id: MappedTypeId) -> Arc<MappedType>

Source

pub fn type_application(&self, id: TypeApplicationId) -> Arc<TypeApplication>

Source

pub fn intern(&self, key: TypeData) -> TypeId

Intern a type key and return its TypeId. If the key already exists, returns the existing TypeId. Otherwise, creates a new TypeId and stores the key.

This uses a lock-free pattern with DashMap for concurrent access.

Source

pub fn lookup(&self, id: TypeId) -> Option<TypeData>

Look up the TypeData for a given TypeId.

This uses lock-free DashMap access with lazy shard initialization.

Source

pub fn intern_object_shape(&self, shape: ObjectShape) -> ObjectShapeId

Source

pub fn len(&self) -> usize

Get the number of interned types (lock-free read)

Source

pub fn is_empty(&self) -> bool

Check if the interner is empty (only has intrinsics)

Source

pub const fn intrinsic(&self, kind: IntrinsicKind) -> TypeId

Intern an intrinsic type

Source

pub fn literal_string(&self, value: &str) -> TypeId

Intern a literal string type

Source

pub fn literal_string_atom(&self, atom: Atom) -> TypeId

Intern a literal string type from an already-interned Atom

Source

pub fn literal_number(&self, value: f64) -> TypeId

Intern a literal number type

Source

pub fn literal_boolean(&self, value: bool) -> TypeId

Intern a literal boolean type

Source

pub fn literal_bigint(&self, value: &str) -> TypeId

Intern a literal bigint type

Source

pub fn literal_bigint_with_sign(&self, negative: bool, digits: &str) -> TypeId

Intern a literal bigint type, allowing a sign prefix without extra clones.

Source

pub fn union(&self, members: Vec<TypeId>) -> TypeId

Intern a union type, normalizing and deduplicating members

Source

pub fn union_from_sorted_vec(&self, flat: Vec<TypeId>) -> TypeId

Intern a union type from a vector that is already sorted and deduped. This is an O(N) operation that avoids redundant sorting.

Source

pub fn union_preserve_members(&self, members: Vec<TypeId>) -> TypeId

Intern a union type while preserving member structure.

This keeps unknown/literal members intact for property access checks.

Source

pub fn union2(&self, left: TypeId, right: TypeId) -> TypeId

Fast path for unions that already fit in registers.

Source

pub fn union3(&self, first: TypeId, second: TypeId, third: TypeId) -> TypeId

Fast path for three-member unions without heap allocations.

Source

pub fn intersection(&self, members: Vec<TypeId>) -> TypeId

Intern an intersection type, normalizing and deduplicating members

Source

pub fn intersection2(&self, left: TypeId, right: TypeId) -> TypeId

Fast path for two-member intersections.

Source

pub fn intersect_types_raw(&self, members: Vec<TypeId>) -> TypeId

Create an intersection type WITHOUT triggering normalize_intersection

This is a low-level operation used by the SubtypeChecker to merge properties from intersection members without causing infinite recursion.

§Safety

Only use this when you need to synthesize a type for intermediate checking. Do NOT use for final compiler output (like .d.ts generation) as the resulting type will be “unsimplified”.

Source

pub fn intersect_types_raw2(&self, a: TypeId, b: TypeId) -> TypeId

Convenience wrapper for raw intersection of two types

Source

pub fn array(&self, element: TypeId) -> TypeId

Intern an array type

Source

pub fn this_type(&self) -> TypeId

Canonical this type.

Source

pub fn readonly_array(&self, element: TypeId) -> TypeId

Intern a readonly array type Returns a distinct type from mutable arrays to enforce readonly semantics

Source

pub fn tuple(&self, elements: Vec<TupleElement>) -> TypeId

Intern a tuple type

Source

pub fn readonly_tuple(&self, elements: Vec<TupleElement>) -> TypeId

Intern a readonly tuple type Returns a distinct type from mutable tuples to enforce readonly semantics

Source

pub fn readonly_type(&self, inner: TypeId) -> TypeId

Wrap any type in a ReadonlyType marker This is used for the readonly type operator

Source

pub fn no_infer(&self, inner: TypeId) -> TypeId

Wrap a type in a NoInfer marker.

Source

pub fn unique_symbol(&self, symbol: SymbolRef) -> TypeId

Create a unique symbol type for a symbol declaration.

Source

pub fn infer(&self, info: TypeParamInfo) -> TypeId

Create an infer binder with the provided info.

Source

pub fn bound_parameter(&self, index: u32) -> TypeId

Source

pub fn recursive(&self, depth: u32) -> TypeId

Source

pub fn keyof(&self, inner: TypeId) -> TypeId

Wrap a type in a KeyOf marker.

Source

pub fn index_access(&self, object_type: TypeId, index_type: TypeId) -> TypeId

Build an indexed access type (T[K]).

Source

pub fn enum_type(&self, def_id: DefId, structural_type: TypeId) -> TypeId

Build a nominal enum type that preserves DefId identity and carries structural member information for compatibility with primitive relations.

Source

pub fn object(&self, properties: Vec<PropertyInfo>) -> TypeId

Intern an object type with properties.

Source

pub fn object_fresh(&self, properties: Vec<PropertyInfo>) -> TypeId

Intern a fresh object type with properties.

Source

pub fn object_with_flags( &self, properties: Vec<PropertyInfo>, flags: ObjectFlags, ) -> TypeId

Intern an object type with properties and custom flags.

Source

pub fn object_with_flags_and_symbol( &self, properties: Vec<PropertyInfo>, flags: ObjectFlags, symbol: Option<SymbolId>, ) -> TypeId

Intern an object type with properties, custom flags, and optional symbol. This is used for interfaces that need symbol tracking but no index signatures.

Source

pub fn object_with_index(&self, shape: ObjectShape) -> TypeId

Intern an object type with index signatures.

Source

pub fn function(&self, shape: FunctionShape) -> TypeId

Intern a function type

Source

pub fn callable(&self, shape: CallableShape) -> TypeId

Intern a callable type with overloaded signatures

Source

pub fn conditional(&self, conditional: ConditionalType) -> TypeId

Intern a conditional type

Source

pub fn mapped(&self, mapped: MappedType) -> TypeId

Intern a mapped type

Source

pub fn string_intrinsic( &self, kind: StringIntrinsicKind, type_arg: TypeId, ) -> TypeId

Build a string intrinsic (Uppercase, Lowercase, etc.) marker.

Source

pub fn reference(&self, symbol: SymbolRef) -> TypeId

Intern a type reference (deprecated - use lazy() with DefId instead).

This method is kept for backward compatibility with tests and legacy code. It converts SymbolRef to DefId and creates TypeData::Lazy.

Deprecated: new code should use lazy(def_id) instead.

Source

pub fn lazy(&self, def_id: DefId) -> TypeId

Intern a lazy type reference (DefId-based).

This is the replacement for reference() that uses Solver-owned DefIds instead of Binder-owned SymbolRefs.

Use this method for all new type references to enable O(1) type equality across Binder and Solver boundaries.

Source

pub fn type_param(&self, info: TypeParamInfo) -> TypeId

Intern a type parameter.

Source

pub fn type_query(&self, symbol: SymbolRef) -> TypeId

Intern a type query (typeof value) marker.

Source

pub fn application(&self, base: TypeId, args: Vec<TypeId>) -> TypeId

Intern a generic type application

Trait Implementations§

Source§

impl Debug for TypeInterner

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for TypeInterner

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl QueryDatabase for TypeInterner

Source§

fn as_type_database(&self) -> &dyn TypeDatabase

Expose the underlying TypeDatabase view for legacy entry points.
Source§

fn register_array_base_type( &self, type_id: TypeId, type_params: Vec<TypeParamInfo>, )

Register the canonical Array<T> base type used by property access resolution. Read more
Source§

fn register_boxed_type(&self, kind: IntrinsicKind, type_id: TypeId)

Register a boxed interface type for a primitive intrinsic kind. Read more
Source§

fn get_index_signatures(&self, type_id: TypeId) -> IndexInfo

Get index signatures for a type
Source§

fn is_nullish_type(&self, type_id: TypeId) -> bool

Check if a type contains null or undefined
Source§

fn remove_nullish(&self, type_id: TypeId) -> TypeId

Remove null and undefined from a type
Source§

fn is_assignable_to(&self, source: TypeId, target: TypeId) -> bool

TypeScript assignability check with full compatibility rules (The Lawyer). Read more
Source§

fn is_assignable_to_with_flags( &self, source: TypeId, target: TypeId, flags: u16, ) -> bool

Assignability check with explicit compiler flags. Read more
Source§

fn resolve_property_access( &self, object_type: TypeId, prop_name: &str, ) -> PropertyAccessResult

Source§

fn resolve_property_access_with_options( &self, object_type: TypeId, prop_name: &str, no_unchecked_indexed_access: bool, ) -> PropertyAccessResult

Source§

fn get_type_param_variance(&self, _def_id: DefId) -> Option<Arc<[Variance]>>

Task #41: Get the variance mask for a generic type definition. Read more
Source§

fn canonical_id(&self, type_id: TypeId) -> TypeId

Get the canonical TypeId for a type, achieving O(1) structural identity checks. Read more
Source§

fn factory(&self) -> TypeFactory<'_>

Expose the checked construction surface for type constructors.
Source§

fn evaluate_conditional(&self, cond: &ConditionalType) -> TypeId

Source§

fn evaluate_index_access( &self, object_type: TypeId, index_type: TypeId, ) -> TypeId

Source§

fn evaluate_index_access_with_options( &self, object_type: TypeId, index_type: TypeId, no_unchecked_indexed_access: bool, ) -> TypeId

Source§

fn evaluate_type(&self, type_id: TypeId) -> TypeId

Source§

fn evaluate_type_with_options( &self, type_id: TypeId, no_unchecked_indexed_access: bool, ) -> TypeId

Source§

fn evaluate_mapped(&self, mapped: &MappedType) -> TypeId

Source§

fn lookup_application_eval_cache( &self, _def_id: DefId, _args: &[TypeId], _no_unchecked_indexed_access: bool, ) -> Option<TypeId>

Look up a shared cache entry for evaluated generic applications.
Source§

fn insert_application_eval_cache( &self, _def_id: DefId, _args: &[TypeId], _no_unchecked_indexed_access: bool, _result: TypeId, )

Store an evaluated generic application result in the shared cache.
Source§

fn evaluate_keyof(&self, operand: TypeId) -> TypeId

Source§

fn narrow(&self, type_id: TypeId, narrower: TypeId) -> TypeId
where Self: Sized,

Source§

fn property_access_type( &self, object_type: TypeId, prop_name: &str, ) -> PropertyAccessResult

Source§

fn no_unchecked_indexed_access(&self) -> bool

Source§

fn set_no_unchecked_indexed_access(&self, _enabled: bool)

Source§

fn contextual_property_type( &self, expected: TypeId, prop_name: &str, ) -> Option<TypeId>

Source§

fn is_property_readonly(&self, object_type: TypeId, prop_name: &str) -> bool

Source§

fn is_readonly_index_signature( &self, object_type: TypeId, wants_string: bool, wants_number: bool, ) -> bool

Source§

fn resolve_element_access( &self, object_type: TypeId, index_type: TypeId, literal_index: Option<usize>, ) -> ElementAccessResult

Resolve element access (array/tuple indexing) with detailed error reporting
Source§

fn resolve_element_access_type( &self, object_type: TypeId, index_type: TypeId, literal_index: Option<usize>, ) -> TypeId

Resolve element access type with cache-friendly error normalization.
Source§

fn collect_object_spread_properties( &self, spread_type: TypeId, ) -> Vec<PropertyInfo>

Collect properties that can be spread into object literals.
Source§

fn is_subtype_of(&self, source: TypeId, target: TypeId) -> bool

Subtype check with compiler flags. Read more
Source§

fn is_subtype_of_with_flags( &self, source: TypeId, target: TypeId, flags: u16, ) -> bool

Subtype check with explicit compiler flags. Read more
Source§

fn lookup_subtype_cache(&self, _key: RelationCacheKey) -> Option<bool>

Look up a cached subtype result for the given key. Returns None if the result is not cached. Default implementation returns None (no caching).
Source§

fn insert_subtype_cache(&self, _key: RelationCacheKey, _result: bool)

Cache a subtype result for the given key. Default implementation is a no-op.
Source§

fn lookup_assignability_cache(&self, _key: RelationCacheKey) -> Option<bool>

Look up a cached assignability result for the given key. Returns None if the result is not cached. Default implementation returns None (no caching).
Source§

fn insert_assignability_cache(&self, _key: RelationCacheKey, _result: bool)

Cache an assignability result for the given key. Default implementation is a no-op.
Source§

fn new_inference_context(&self) -> InferenceContext<'_>

Source§

impl TypeDatabase for TypeInterner

Source§

fn intern(&self, key: TypeData) -> TypeId

Source§

fn lookup(&self, id: TypeId) -> Option<TypeData>

Source§

fn intern_string(&self, s: &str) -> Atom

Source§

fn resolve_atom(&self, atom: Atom) -> String

Source§

fn resolve_atom_ref(&self, atom: Atom) -> Arc<str>

Source§

fn type_list(&self, id: TypeListId) -> Arc<[TypeId]>

Source§

fn tuple_list(&self, id: TupleListId) -> Arc<[TupleElement]>

Source§

fn template_list(&self, id: TemplateLiteralId) -> Arc<[TemplateSpan]>

Source§

fn object_shape(&self, id: ObjectShapeId) -> Arc<ObjectShape>

Source§

fn object_property_index( &self, shape_id: ObjectShapeId, name: Atom, ) -> PropertyLookup

Source§

fn function_shape(&self, id: FunctionShapeId) -> Arc<FunctionShape>

Source§

fn callable_shape(&self, id: CallableShapeId) -> Arc<CallableShape>

Source§

fn conditional_type(&self, id: ConditionalTypeId) -> Arc<ConditionalType>

Source§

fn mapped_type(&self, id: MappedTypeId) -> Arc<MappedType>

Source§

fn type_application(&self, id: TypeApplicationId) -> Arc<TypeApplication>

Source§

fn literal_string(&self, value: &str) -> TypeId

Source§

fn literal_number(&self, value: f64) -> TypeId

Source§

fn literal_boolean(&self, value: bool) -> TypeId

Source§

fn literal_bigint(&self, value: &str) -> TypeId

Source§

fn literal_bigint_with_sign(&self, negative: bool, digits: &str) -> TypeId

Source§

fn union(&self, members: Vec<TypeId>) -> TypeId

Source§

fn union_from_sorted_vec(&self, flat: Vec<TypeId>) -> TypeId

Source§

fn union2(&self, left: TypeId, right: TypeId) -> TypeId

Source§

fn union3(&self, first: TypeId, second: TypeId, third: TypeId) -> TypeId

Source§

fn intersection(&self, members: Vec<TypeId>) -> TypeId

Source§

fn intersection2(&self, left: TypeId, right: TypeId) -> TypeId

Source§

fn intersect_types_raw2(&self, left: TypeId, right: TypeId) -> TypeId

Raw intersection without normalization (used to avoid infinite recursion)
Source§

fn array(&self, element: TypeId) -> TypeId

Source§

fn tuple(&self, elements: Vec<TupleElement>) -> TypeId

Source§

fn object(&self, properties: Vec<PropertyInfo>) -> TypeId

Source§

fn object_with_flags( &self, properties: Vec<PropertyInfo>, flags: ObjectFlags, ) -> TypeId

Source§

fn object_with_flags_and_symbol( &self, properties: Vec<PropertyInfo>, flags: ObjectFlags, symbol: Option<SymbolId>, ) -> TypeId

Source§

fn object_with_index(&self, shape: ObjectShape) -> TypeId

Source§

fn function(&self, shape: FunctionShape) -> TypeId

Source§

fn callable(&self, shape: CallableShape) -> TypeId

Source§

fn template_literal(&self, spans: Vec<TemplateSpan>) -> TypeId

Source§

fn conditional(&self, conditional: ConditionalType) -> TypeId

Source§

fn mapped(&self, mapped: MappedType) -> TypeId

Source§

fn reference(&self, symbol: SymbolRef) -> TypeId

Source§

fn lazy(&self, def_id: DefId) -> TypeId

Source§

fn bound_parameter(&self, index: u32) -> TypeId

Source§

fn recursive(&self, depth: u32) -> TypeId

Source§

fn type_param(&self, info: TypeParamInfo) -> TypeId

Source§

fn type_query(&self, symbol: SymbolRef) -> TypeId

Source§

fn enum_type(&self, def_id: DefId, structural_type: TypeId) -> TypeId

Source§

fn application(&self, base: TypeId, args: Vec<TypeId>) -> TypeId

Source§

fn literal_string_atom(&self, atom: Atom) -> TypeId

Source§

fn union_preserve_members(&self, members: Vec<TypeId>) -> TypeId

Source§

fn readonly_type(&self, inner: TypeId) -> TypeId

Source§

fn keyof(&self, inner: TypeId) -> TypeId

Source§

fn index_access(&self, object_type: TypeId, index_type: TypeId) -> TypeId

Source§

fn this_type(&self) -> TypeId

Source§

fn no_infer(&self, inner: TypeId) -> TypeId

Source§

fn unique_symbol(&self, symbol: SymbolRef) -> TypeId

Source§

fn infer(&self, info: TypeParamInfo) -> TypeId

Source§

fn string_intrinsic( &self, kind: StringIntrinsicKind, type_arg: TypeId, ) -> TypeId

Source§

fn get_class_base_type(&self, _symbol_id: SymbolId) -> Option<TypeId>

Get the base class type for a symbol (class/interface). Returns the TypeId of the extends clause, or None if the symbol doesn’t extend anything. This is used by the BCT algorithm to find common base classes.
Source§

fn is_identity_comparable_type(&self, type_id: TypeId) -> bool

Check if a type can be compared by TypeId identity alone (O(1) equality). Identity-comparable types include literals, enum members, unique symbols, null, undefined, void, never, and tuples composed entirely of identity-comparable types. Results are cached for O(1) lookup after first computation.
Source§

fn object_fresh(&self, properties: Vec<PropertyInfo>) -> TypeId

Source§

impl TypeResolver for TypeInterner

Implement TypeResolver for TypeInterner with noop resolution.

TypeInterner doesn’t have access to the Binder or type environment, so it cannot resolve symbol references or DefIds. Only resolve_ref (required) is explicitly implemented; all other resolution methods inherit the trait’s default None/false behavior. The three boxed/array methods delegate to TypeInterner’s own inherent methods.

Source§

fn resolve_ref( &self, _symbol: SymbolRef, _interner: &dyn TypeDatabase, ) -> Option<TypeId>

Resolve a symbol reference to its structural type. Returns None if the symbol cannot be resolved. Read more
Source§

fn get_boxed_type(&self, kind: IntrinsicKind) -> Option<TypeId>

Get the boxed interface type for a primitive intrinsic (Rule #33). For example, IntrinsicKind::Number -> TypeId of the Number interface. This enables primitives to be subtypes of their boxed interfaces.
Source§

fn get_array_base_type(&self) -> Option<TypeId>

Get the Array interface type from lib.d.ts.
Source§

fn get_array_base_type_params(&self) -> &[TypeParamInfo]

Get the type parameters for the Array interface.
Source§

fn resolve_symbol_ref( &self, symbol: SymbolRef, interner: &dyn TypeDatabase, ) -> Option<TypeId>

Resolve a symbol reference to a structural type, preferring DefId-based lazy paths. Read more
Source§

fn resolve_lazy( &self, _def_id: DefId, _interner: &dyn TypeDatabase, ) -> Option<TypeId>

Resolve a DefId reference to its structural type. Read more
Source§

fn get_type_params(&self, _symbol: SymbolRef) -> Option<Vec<TypeParamInfo>>

Get type parameters for a symbol (for generic type aliases/interfaces). Returns None by default; implementations can override to support Application type expansion.
Source§

fn get_lazy_type_params(&self, _def_id: DefId) -> Option<Vec<TypeParamInfo>>

Get type parameters for a DefId (for generic type aliases/interfaces). Read more
Source§

fn def_to_symbol_id(&self, _def_id: DefId) -> Option<SymbolId>

Get the SymbolId for a DefId (bridge for InheritanceGraph). Read more
Source§

fn symbol_to_def_id(&self, _symbol: SymbolRef) -> Option<DefId>

Get the DefId for a SymbolRef (Ref -> Lazy migration). Read more
Source§

fn get_def_kind(&self, _def_id: DefId) -> Option<DefKind>

Get the DefKind for a DefId (Task #32: Graph Isomorphism). Read more
Source§

fn is_boxed_def_id(&self, _def_id: DefId, _kind: IntrinsicKind) -> bool

Check if a DefId corresponds to a boxed type for the given intrinsic kind.
Source§

fn is_boxed_type_id(&self, _type_id: TypeId, _kind: IntrinsicKind) -> bool

Check if a TypeId is any known resolved form of a boxed type. Read more
Source§

fn get_lazy_export(&self, _def_id: DefId, _name: Atom) -> Option<TypeId>

Get an export from a namespace/module by name. Read more
Source§

fn get_lazy_enum_member(&self, _def_id: DefId, _name: Atom) -> Option<TypeId>

Get enum member type by name from an enum DefId. Read more
Source§

fn is_numeric_enum(&self, _def_id: DefId) -> bool

Check if a DefId corresponds to a numeric enum (not a string enum). Read more
Source§

fn is_enum_type(&self, _type_id: TypeId, _interner: &dyn TypeDatabase) -> bool

Check if a TypeId represents a full Enum type (not a specific member).
Source§

fn get_enum_parent_def_id(&self, _member_def_id: DefId) -> Option<DefId>

Get the parent Enum’s DefId for an Enum Member’s DefId. Read more
Source§

fn is_user_enum_def(&self, _def_id: DefId) -> bool

Check if a DefId represents a user-defined enum (not an intrinsic type).
Source§

fn get_base_type( &self, _type_id: TypeId, _interner: &dyn TypeDatabase, ) -> Option<TypeId>

Get the base class type for a class/interface type. Read more
Source§

fn get_type_param_variance(&self, _def_id: DefId) -> Option<Arc<[Variance]>>

Get the variance mask for type parameters of a generic type (Task #41). Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<S, T> Upcast<T> for S
where T: UpcastFrom<S> + ?Sized, S: ?Sized,

Source§

fn upcast(&self) -> &T
where Self: ErasableGeneric, T: ErasableGeneric<Repr = Self::Repr>,

Perform a zero-cost type-safe upcast to a wider ref type within the Wasm bindgen generics type system. Read more
Source§

fn upcast_into(self) -> T
where Self: Sized + ErasableGeneric, T: ErasableGeneric<Repr = Self::Repr>,

Perform a zero-cost type-safe upcast to a wider type within the Wasm bindgen generics type system. Read more
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more