pub struct DefaultJudge<'a> { /* private fields */ }Expand description
Default implementation of the Judge trait.
Uses basic caching with FxHashMap. For production use with incremental
compilation, consider a Salsa-based implementation.
Implementations§
Source§impl<'a> DefaultJudge<'a>
impl<'a> DefaultJudge<'a>
Sourcepub fn new(
db: &'a dyn TypeDatabase,
env: &'a TypeEnvironment,
config: JudgeConfig,
) -> Self
pub fn new( db: &'a dyn TypeDatabase, env: &'a TypeEnvironment, config: JudgeConfig, ) -> Self
Create a new Judge with the given database and configuration.
Sourcepub fn with_defaults(db: &'a dyn TypeDatabase, env: &'a TypeEnvironment) -> Self
pub fn with_defaults(db: &'a dyn TypeDatabase, env: &'a TypeEnvironment) -> Self
Create a Judge with default configuration.
Sourcepub fn clear_caches(&self)
pub fn clear_caches(&self)
Clear all caches.
Sourcepub fn db(&self) -> &'a dyn TypeDatabase
pub fn db(&self) -> &'a dyn TypeDatabase
Get the underlying database.
Trait Implementations§
Source§impl<'a> Judge for DefaultJudge<'a>
impl<'a> Judge for DefaultJudge<'a>
Source§fn evaluate(&self, type_id: TypeId) -> TypeId
fn evaluate(&self, type_id: TypeId) -> TypeId
Evaluate a type, resolving meta-types (conditional, mapped, keyof, etc.). Read more
Source§fn instantiate(&self, generic: TypeId, args: &[TypeId]) -> TypeId
fn instantiate(&self, generic: TypeId, args: &[TypeId]) -> TypeId
Instantiate a generic type with type arguments. Read more
Source§fn classify_iterable(&self, type_id: TypeId) -> IterableKind
fn classify_iterable(&self, type_id: TypeId) -> IterableKind
Classify how a type can be iterated. Read more
Source§fn classify_callable(&self, type_id: TypeId) -> CallableKind
fn classify_callable(&self, type_id: TypeId) -> CallableKind
Classify how a type can be called. Read more
Source§fn classify_primitive(&self, type_id: TypeId) -> PrimitiveFlags
fn classify_primitive(&self, type_id: TypeId) -> PrimitiveFlags
Get primitive-like behavior flags for a type. Read more
Source§fn classify_truthiness(&self, type_id: TypeId) -> TruthinessKind
fn classify_truthiness(&self, type_id: TypeId) -> TruthinessKind
Classify a type’s truthiness behavior. Read more
Source§fn apparent_type(&self, type_id: TypeId) -> TypeId
fn apparent_type(&self, type_id: TypeId) -> TypeId
Get the apparent type (unwrap type params, resolve constraints).
Source§fn get_property(&self, type_id: TypeId, name: Atom) -> PropertyResult
fn get_property(&self, type_id: TypeId, name: Atom) -> PropertyResult
Get a specific property’s type from a type. Read more
Source§fn get_members(&self, type_id: TypeId) -> Arc<Vec<(Atom, TypeId)>>
fn get_members(&self, type_id: TypeId) -> Arc<Vec<(Atom, TypeId)>>
Get all members of a type as (name, type) pairs.
Source§fn get_call_signatures(&self, type_id: TypeId) -> Arc<Vec<CallSignature>>
fn get_call_signatures(&self, type_id: TypeId) -> Arc<Vec<CallSignature>>
Get call signatures of a type.
Source§fn get_construct_signatures(&self, type_id: TypeId) -> Arc<Vec<CallSignature>>
fn get_construct_signatures(&self, type_id: TypeId) -> Arc<Vec<CallSignature>>
Get construct signatures of a type.
Source§fn get_index_type(&self, object: TypeId, key: TypeId) -> TypeId
fn get_index_type(&self, object: TypeId, key: TypeId) -> TypeId
Get the result of indexing: T[K]
Source§fn get_index_signature(
&self,
type_id: TypeId,
kind: IndexKind,
) -> Option<TypeId>
fn get_index_signature( &self, type_id: TypeId, kind: IndexKind, ) -> Option<TypeId>
Get index signature type (string or number indexer).
Source§fn config(&self) -> &JudgeConfig
fn config(&self) -> &JudgeConfig
Get the current configuration.
Auto Trait Implementations§
impl<'a> !Freeze for DefaultJudge<'a>
impl<'a> !RefUnwindSafe for DefaultJudge<'a>
impl<'a> !Send for DefaultJudge<'a>
impl<'a> !Sync for DefaultJudge<'a>
impl<'a> Unpin for DefaultJudge<'a>
impl<'a> UnsafeUnpin for DefaultJudge<'a>
impl<'a> !UnwindSafe for DefaultJudge<'a>
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