Trait liquid_compiler::ParseBlock
source · pub trait ParseBlock: Send + Sync + ParseBlockClone {
fn parse(
&self,
tag_name: &str,
arguments: &[Token],
tokens: &[Element],
options: &LiquidOptions
) -> Result<Box<dyn Renderable>>;
}Expand description
A trait for creating custom custom block-size tags ({% if something %}{% endif %}).
This is a simple type alias for a function.
This function will be called whenever the parser encounters a block and returns
a new Renderable based on its parameters. The received parameters specify the name
of the block, the argument Tokens passed to
the block, a Vec of all Elements inside the block and
the global LiquidOptions.
Required Methods
fn parse(
&self,
tag_name: &str,
arguments: &[Token],
tokens: &[Element],
options: &LiquidOptions
) -> Result<Box<dyn Renderable>>
Trait Implementations
sourceimpl Clone for Box<dyn ParseBlock>
impl Clone for Box<dyn ParseBlock>
sourcefn clone(&self) -> Box<dyn ParseBlock>
fn clone(&self) -> Box<dyn ParseBlock>
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