pub struct TemplateDefinition { /* private fields */ }
Expand description
Definition of a template function
Implementations
sourceimpl TemplateDefinition
impl TemplateDefinition
sourcepub fn parameters(&self) -> &[TemplateParameter]
pub fn parameters(&self) -> &[TemplateParameter]
Get the list of parameters of this template
sourcepub fn generate_id(&self, args: &[(Expr, &str)], scope: &dyn Scope) -> SmolStr
pub fn generate_id(&self, args: &[(Expr, &str)], scope: &dyn Scope) -> SmolStr
Generate a unique ID for the given template invocation
Parameters
args
: list of template parameter values used in the invocationconfig
: scope in which this identifier should be generated
sourcepub fn instantiate(
&self,
scope: &mut LocalScope<'_, '_>,
outer_instantiator: &InstantiateTemplate
) -> Result<Vec<FunctionDefinition>>
pub fn instantiate(
&self,
scope: &mut LocalScope<'_, '_>,
outer_instantiator: &InstantiateTemplate
) -> Result<Vec<FunctionDefinition>>
Instantiate this template definition into a GLSL function
Parameters
scope
: local scope this template is being instantiated fromouter_instantiator
: outer instantiation contextconfig
: transformation config
sourcepub fn extract_template_parameters(
&self,
args: &mut Vec<Expr>
) -> Result<Vec<(Expr, &str)>>
pub fn extract_template_parameters(
&self,
args: &mut Vec<Expr>
) -> Result<Vec<(Expr, &str)>>
Extract the template parameters from the full set of call parameters
Parameters
args
: list of all function call arguments
Returns
List of expressions to be used in the template call. args
will contain regular arguments
to the GLSL function (which do not require a template instantiation).
Trait Implementations
sourceimpl Clone for TemplateDefinition
impl Clone for TemplateDefinition
sourcefn clone(&self) -> TemplateDefinition
fn clone(&self) -> TemplateDefinition
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
Auto Trait Implementations
impl RefUnwindSafe for TemplateDefinition
impl Send for TemplateDefinition
impl Sync for TemplateDefinition
impl Unpin for TemplateDefinition
impl UnwindSafe for TemplateDefinition
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
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
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
🔬 This is a nightly-only experimental API. (
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more