Struct glslt::transform::template::TemplateDefinition[][src]

pub struct TemplateDefinition { /* fields omitted */ }

Definition of a template function

Implementations

impl TemplateDefinition[src]

pub fn ast(&self) -> &FunctionDefinition[src]

Get the AST of this template definition

pub fn parameters(&self) -> &[TemplateParameter][src]

Get the list of parameters of this template

pub fn fn_ref(&self) -> Node<FnRef<'_>>[src]

Get the FnRef definition of this template

pub fn generate_id(&self, args: &[(Expr, &str)]) -> SmolStr[src]

Generate a unique ID for the given template invocation

Parameters

  • args: list of template parameter values used in the invocation

pub fn instantiate(
    &self,
    scope: &mut LocalScope<'_, '_>,
    outer_instantiator: &InstantiateTemplate
) -> Result<Vec<FunctionDefinition>>
[src]

Instantiate this template definition into a GLSL function

Parameters

  • scope: local scope this template is being instantiated from

pub fn extract_template_parameters(
    &self,
    args: &mut Vec<Expr>
) -> Result<Vec<(Expr, &str)>>
[src]

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

impl Clone for TemplateDefinition[src]

impl Debug for TemplateDefinition[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> IntoResult<T> for T

type Err = Infallible

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.