pub struct Unit { /* private fields */ }
Expand description
GLSLT template instantiation context
Implementations§
source§impl Unit
impl Unit
sourcepub fn with_context(global_scope: GlobalScope) -> Self
pub fn with_context(global_scope: GlobalScope) -> Self
Create a new 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 into_translation_unit(self) -> Result<TranslationUnit>
pub fn into_translation_unit(self) -> Result<TranslationUnit>
Transform this unit into a GLSL syntax tree
All the declarations given as input will be included in-order in the output, with the template instantiations interleaved when needed.
Trait Implementations§
source§impl TransformUnit for Unit
impl TransformUnit for Unit
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
Auto Trait Implementations§
impl RefUnwindSafe for Unit
impl Send for Unit
impl Sync for Unit
impl Unpin for Unit
impl UnwindSafe for Unit
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more