pub struct EncapsulatingLoweringContext<'db> {
pub db: &'db dyn Database,
pub semantic_function_id: FunctionWithBodyId<'db>,
pub function_body: &'db FunctionBody<'db>,
pub semantic_defs: UnorderedHashMap<VarId<'db>, Binding<'db>>,
pub expr_formatter: ExprFormatter<'db>,
pub usages: Usages<'db>,
pub lowerings: OrderedHashMap<GeneratedFunctionKey<'db>, Lowered<'db>>,
}Expand description
Lowering context for the encapsulating semantic function.
Each semantic function may generate multiple lowered functions. This context is common to all the generated lowered functions of an encapsulating semantic function.
Fields§
§db: &'db dyn Database§semantic_function_id: FunctionWithBodyId<'db>Id for the current function being lowered.
function_body: &'db FunctionBody<'db>Semantic model for current function body.
semantic_defs: UnorderedHashMap<VarId<'db>, Binding<'db>>Definitions encountered for semantic bindings. Since Constants are not lowered, this is only used for variables.
expr_formatter: ExprFormatter<'db>Expression formatter of the free function.
usages: Usages<'db>Block usages for the entire encapsulating function.
lowerings: OrderedHashMap<GeneratedFunctionKey<'db>, Lowered<'db>>Lowerings of generated functions.
Implementations§
Source§impl<'db> EncapsulatingLoweringContext<'db>
impl<'db> EncapsulatingLoweringContext<'db>
pub fn new( db: &'db dyn Database, semantic_function_id: FunctionWithBodyId<'db>, ) -> Maybe<Self>
Auto Trait Implementations§
impl<'db> Freeze for EncapsulatingLoweringContext<'db>
impl<'db> !RefUnwindSafe for EncapsulatingLoweringContext<'db>
impl<'db> !Send for EncapsulatingLoweringContext<'db>
impl<'db> !Sync for EncapsulatingLoweringContext<'db>
impl<'db> Unpin for EncapsulatingLoweringContext<'db>
impl<'db> !UnwindSafe for EncapsulatingLoweringContext<'db>
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