Trait glslt::transform::TransformUnit
source · pub trait TransformUnit {
// Required methods
fn global_scope(&self) -> &GlobalScope;
fn global_scope_mut(&mut self) -> &mut GlobalScope;
fn push_function_declaration(&mut self, def: FunctionDefinition);
fn parse_external_declaration(
&mut self,
extdecl: ExternalDeclaration,
) -> Result<Option<FnHandle<'_>>>;
}
Expand description
Represent a GLSLT transform unit
The entry point of transform units is the parse_external_declaration, which processes its input syntax as GLSLT and updates the internal state of the transform unit accordingly. The other methods are for internal operation.
Required Methods§
sourcefn global_scope(&self) -> &GlobalScope
fn global_scope(&self) -> &GlobalScope
Obtain a reference to the template definition context
sourcefn global_scope_mut(&mut self) -> &mut GlobalScope
fn global_scope_mut(&mut self) -> &mut GlobalScope
Obtain a mutable reference to the template definition context
sourcefn push_function_declaration(&mut self, def: FunctionDefinition)
fn push_function_declaration(&mut self, def: FunctionDefinition)
Add a function declaration to the transform unit
§Parameters
def
: syntax tree for the function definition
sourcefn parse_external_declaration(
&mut self,
extdecl: ExternalDeclaration,
) -> Result<Option<FnHandle<'_>>>
fn parse_external_declaration( &mut self, extdecl: ExternalDeclaration, ) -> Result<Option<FnHandle<'_>>>
Parse a GLSLT declaration and add it to the transform unit
§Parameters
extdecl
: top-level declaration to parse as GLSLT