Enum twig::nodes::body::Body [] [src]

pub enum Body<'c> {
    List {
        items: Vec<Body<'c>>,
    },
    Text {
        value: &'c str,
        line: usize,
    },
    Print {
        expr: Box<Expr<'c>>,
        line: usize,
    },
    Import {
        source: Box<Expr<'c>>,
        targets: Vec<(Uuid, &'c str, ImportTarget<'c>)>,
        line: usize,
    },
    Macro {
        name: &'c str,
        body: Box<Body<'c>>,
        arguments: Vec<(Option<&'c str>, Expr<'c>)>,
        line: usize,
    },
}

Variants

List

Fields

items
Text

Fields

value
line
Print

Fields

expr
line
Import

Fields

source

Target template to import, which can be evaluated at runtime from provided expression.

targets

Target list alias => name.

line
Macro

Fields

name
body
arguments
line

Methods

impl<'c> Body<'c>

fn new() -> Body<'c>

fn expect_print<'r>(&'r self) -> &'r Expr<'c>

fn expect_list<'r>(&'r self) -> &'r Vec<Body<'c>>

impl<'c> Body<'c>

fn new() -> Body<'c>

fn expect_print<'r>(&'r self) -> &'r Expr<'c>

fn expect_list<'r>(&'r self) -> &'r Vec<Body<'c>>

Trait Implementations

impl<'c> Parse<'c> for Body<'c>

type Output = Body<'c>

fn parse<'r>(parser: &mut Parser<'r, 'c>) -> TemplateResult<Body<'c>>

impl<'c> Parse<'c> for Body<'c>

type Output = Body<'c>

fn parse<'r>(parser: &mut Parser<'r, 'c>) -> TemplateResult<Body<'c>>

impl<'c> Compile<'c> for Body<'c>

fn compile<'r>(&'r self, stage: &'r mut Staging<'c, Value>) -> TemplateResult<()>

Derived Implementations

impl<'c> Debug for Body<'c>

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

impl<'c> Debug for Body<'c>

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