pub struct ComputationContext<'ctx, 'mt> {
pub db: &'ctx dyn Database,
pub diagnostics: &'mt mut SemanticDiagnostics<'ctx>,
pub resolver: &'mt mut Resolver<'ctx>,
pub arenas: Arenas<'ctx>,
pub semantic_defs: UnorderedHashMap<VarId<'ctx>, Binding<'ctx>>,
/* private fields */
}Expand description
Context for computing the semantic model of expression trees.
Fields§
§db: &'ctx dyn Database§diagnostics: &'mt mut SemanticDiagnostics<'ctx>§resolver: &'mt mut Resolver<'ctx>§arenas: Arenas<'ctx>Arenas of semantic objects.
semantic_defs: UnorderedHashMap<VarId<'ctx>, Binding<'ctx>>Definitions of semantic variables.
Implementations§
Source§impl<'ctx, 'mt> ComputationContext<'ctx, 'mt>
impl<'ctx, 'mt> ComputationContext<'ctx, 'mt>
Sourcepub fn new(
db: &'ctx dyn Database,
diagnostics: &'mt mut SemanticDiagnostics<'ctx>,
resolver: &'mt mut Resolver<'ctx>,
signature: Option<&'mt Signature<'ctx>>,
environment: Environment<'ctx>,
function_id: ContextFunction<'ctx>,
) -> Self
pub fn new( db: &'ctx dyn Database, diagnostics: &'mt mut SemanticDiagnostics<'ctx>, resolver: &'mt mut Resolver<'ctx>, signature: Option<&'mt Signature<'ctx>>, environment: Environment<'ctx>, function_id: ContextFunction<'ctx>, ) -> Self
Creates a new computation context.
Sourcepub fn new_global(
db: &'ctx dyn Database,
diagnostics: &'mt mut SemanticDiagnostics<'ctx>,
resolver: &'mt mut Resolver<'ctx>,
) -> Self
pub fn new_global( db: &'ctx dyn Database, diagnostics: &'mt mut SemanticDiagnostics<'ctx>, resolver: &'mt mut Resolver<'ctx>, ) -> Self
Creates a new computation context for a global scope.
Sourcepub fn apply_inference_rewriter_to_exprs(&mut self)
pub fn apply_inference_rewriter_to_exprs(&mut self)
Applies inference rewriter to all the expressions in the computation context, and adds errors on types from the final expressions.
Auto Trait Implementations§
impl<'ctx, 'mt> Freeze for ComputationContext<'ctx, 'mt>
impl<'ctx, 'mt> !RefUnwindSafe for ComputationContext<'ctx, 'mt>
impl<'ctx, 'mt> !Send for ComputationContext<'ctx, 'mt>
impl<'ctx, 'mt> !Sync for ComputationContext<'ctx, 'mt>
impl<'ctx, 'mt> Unpin for ComputationContext<'ctx, 'mt>
impl<'ctx, 'mt> !UnwindSafe for ComputationContext<'ctx, 'mt>
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<'db, T> DebugDbUpcast<'db, T> for Twhere
T: ?Sized,
impl<'db, T> DebugDbUpcast<'db, T> for Twhere
T: ?Sized,
fn debug_db_upcast(&'db self) -> &'db T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more