Struct naga::front::wgsl::lower::GlobalContext

source ·
pub struct GlobalContext<'source, 'temp, 'out> {
    ast_expressions: &'temp Arena<Expression<'source>>,
    types: &'temp Arena<Type<'source>>,
    globals: &'temp mut FastHashMap<&'source str, LoweredGlobalDecl>,
    module: &'out mut Module,
    const_typifier: &'temp mut Typifier,
    global_expression_kind_tracker: &'temp mut ExpressionKindTracker,
}
Expand description

State for constructing a crate::Module.

Fields§

§ast_expressions: &'temp Arena<Expression<'source>>

The TranslationUnit’s expressions arena.

§types: &'temp Arena<Type<'source>>

The TranslationUnit’s types arena.

§globals: &'temp mut FastHashMap<&'source str, LoweredGlobalDecl>

The map from the names of module-scope declarations to the Naga IR Handles we have built for them, owned by Lowerer::lower.

§module: &'out mut Module

The module we’re constructing.

§const_typifier: &'temp mut Typifier§global_expression_kind_tracker: &'temp mut ExpressionKindTracker

Implementations§

source§

impl<'source> GlobalContext<'source, '_, '_>

source

fn as_const(&mut self) -> ExpressionContext<'source, '_, '_>

source

fn as_override(&mut self) -> ExpressionContext<'source, '_, '_>

source

fn ensure_type_exists( &mut self, name: Option<String>, inner: TypeInner, ) -> Handle<Type>

Auto Trait Implementations§

§

impl<'source, 'temp, 'out> Freeze for GlobalContext<'source, 'temp, 'out>

§

impl<'source, 'temp, 'out> RefUnwindSafe for GlobalContext<'source, 'temp, 'out>

§

impl<'source, 'temp, 'out> Send for GlobalContext<'source, 'temp, 'out>

§

impl<'source, 'temp, 'out> Sync for GlobalContext<'source, 'temp, 'out>

§

impl<'source, 'temp, 'out> Unpin for GlobalContext<'source, 'temp, 'out>

§

impl<'source, 'temp, 'out> !UnwindSafe for GlobalContext<'source, 'temp, 'out>

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, 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>,

§

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>,

§

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.