Struct twig::function::Function [] [src]

pub struct Function {
    pub name: &'static str,
    pub callable: Callable,
}

Represents environment function.

Fields

name
callable

Methods

impl Function

fn new_dynamic<F: 'static>(name: &'static str, callable: F) -> Function where F: for<'e> Fn(&'e [Value]) -> RuntimeResult<Value>

fn new_static<F: 'static, I: IntoIterator<Item=Arg>>(name: &'static str, arguments: I, compile: F) -> Function where F: for<'c> Fn(&mut Staging<'c, Value>) -> TemplateResult<CompiledExpression>

Trait Implementations

impl Debug for Function

fn fmt(&self, f: &mut Formatter) -> Result