pub struct Module {
    pub types: UniqueArena<Type>,
    pub constants: Arena<Constant>,
    pub global_variables: Arena<GlobalVariable>,
    pub functions: Arena<Function>,
    pub entry_points: Vec<EntryPoint>,
}
Expand description

Shader module.

A module is a set of constants, global variables and functions, as well as the types required to define them.

Some functions are marked as entry points, to be used in a certain shader stage.

To create a new module, use the Default implementation. Alternatively, you can load an existing shader using one of the available front ends.

When finished, you can export modules using one of the available backends.

Fields

types: UniqueArena<Type>

Arena for the types defined in this module.

constants: Arena<Constant>

Arena for the constants defined in this module.

global_variables: Arena<GlobalVariable>

Arena for the global variables defined in this module.

functions: Arena<Function>

Arena for the functions defined in this module.

Each function must appear in this arena strictly before all its callers. Recursion is not supported.

entry_points: Vec<EntryPoint>

Entry points.

Trait Implementations

Generate an arbitrary value of Self from the given unstructured data. Read more
Generate an arbitrary value of Self from the entirety of the given unstructured data. Read more
Get a size hint for how many bytes out of an Unstructured this type needs to construct itself. Read more
Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more
Returns the “default value” for a type. Read more
Deserialize this value from the given Serde deserializer. Read more
Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

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

The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.