pub struct MinUnit { /* private fields */ }
Expand description
Minimizing GLSLT template instantiation context
Implementations§
source§impl MinUnit
impl MinUnit
sourcepub fn with_context(global_scope: GlobalScope) -> Self
pub fn with_context(global_scope: GlobalScope) -> Self
Create a new minifying transform unit using pre-defined templates
Parameters
global_scope
: context to pull pre-defined templates from
sourcepub fn with_config(config: TransformConfig) -> Self
pub fn with_config(config: TransformConfig) -> Self
sourcepub fn iter_functions(&self) -> impl Iterator<Item = Node<FnRef<'_>>>
pub fn iter_functions(&self) -> impl Iterator<Item = Node<FnRef<'_>>>
Obtain an iterator to the functions and templates defined in the current unit
sourcepub fn iter_declarations(&self) -> impl Iterator<Item = &ExternalDeclaration>
pub fn iter_declarations(&self) -> impl Iterator<Item = &ExternalDeclaration>
Obtain an iterator to all the top-level declarations in the current unit
sourcepub fn into_translation_unit<'a>(
self,
wanted: impl Iterator<Item = &'a str>
) -> Result<TranslationUnit>
pub fn into_translation_unit<'a>( self, wanted: impl Iterator<Item = &'a str> ) -> Result<TranslationUnit>
Transform this unit into a GLSL syntax tree
Only the functions included in wanted
and their transitive dependencies will be included
in the output.
Parameters
wanted
: list of function names to include in the result
Trait Implementations§
source§impl TransformUnit for MinUnit
impl TransformUnit for MinUnit
source§fn global_scope(&self) -> &GlobalScope
fn global_scope(&self) -> &GlobalScope
Obtain a reference to the template definition context
source§fn global_scope_mut(&mut self) -> &mut GlobalScope
fn global_scope_mut(&mut self) -> &mut GlobalScope
Obtain a mutable reference to the template definition context
source§fn push_function_declaration(&mut self, def: FunctionDefinition)
fn push_function_declaration(&mut self, def: FunctionDefinition)
Add a function declaration to the transform unit Read more