Trait TemplateLanguage

Source
pub trait TemplateLanguage<'a> {
    type Property: CoreTemplatePropertyVar<'a>;

    // Required methods
    fn settings(&self) -> &UserSettings;
    fn build_function(
        &self,
        diagnostics: &mut TemplateDiagnostics,
        build_ctx: &BuildContext<'_, Self::Property>,
        function: &FunctionCallNode<'_>,
    ) -> TemplateParseResult<Self::Property>;
    fn build_method(
        &self,
        diagnostics: &mut TemplateDiagnostics,
        build_ctx: &BuildContext<'_, Self::Property>,
        property: Self::Property,
        function: &FunctionCallNode<'_>,
    ) -> TemplateParseResult<Self::Property>;
}
Expand description

Callbacks to build language-specific evaluation objects from AST nodes.

Required Associated Types§

Required Methods§

Source

fn settings(&self) -> &UserSettings

Source

fn build_function( &self, diagnostics: &mut TemplateDiagnostics, build_ctx: &BuildContext<'_, Self::Property>, function: &FunctionCallNode<'_>, ) -> TemplateParseResult<Self::Property>

Translates the given global function call to a property.

This should be delegated to CoreTemplateBuildFnTable::build_function().

Source

fn build_method( &self, diagnostics: &mut TemplateDiagnostics, build_ctx: &BuildContext<'_, Self::Property>, property: Self::Property, function: &FunctionCallNode<'_>, ) -> TemplateParseResult<Self::Property>

Implementors§