pub struct Unit { /* private fields */ }
Expand description
GLSLT template instantiation context
Implementations
sourceimpl 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
sourceimpl TransformUnit for Unit
impl TransformUnit for Unit
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 Unit
impl Send for Unit
impl Sync for Unit
impl Unpin for Unit
impl UnwindSafe for Unit
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