pub struct MinUnit { /* private fields */ }
Expand description
Minimizing GLSLT template instantiation context
Implementations
sourceimpl 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
sourceimpl TransformUnit for MinUnit
impl TransformUnit for MinUnit
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 Read more
Auto Trait Implementations
impl RefUnwindSafe for MinUnit
impl Send for MinUnit
impl Sync for MinUnit
impl Unpin for MinUnit
impl UnwindSafe for MinUnit
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more