pub trait ParseBlock:
Send
+ Sync
+ ParseBlockClone {
// Required methods
fn parse(
&self,
arguments: TagTokenIter<'_>,
block: TagBlock<'_, '_>,
options: &Language,
) -> Result<Box<dyn Renderable>>;
fn reflection(&self) -> &dyn BlockReflection;
}
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 TagBlock
inside the block and
the global Language
.
Required Methods§
fn parse( &self, arguments: TagTokenIter<'_>, block: TagBlock<'_, '_>, options: &Language, ) -> Result<Box<dyn Renderable>>
fn reflection(&self) -> &dyn BlockReflection
Trait Implementations§
Source§impl Clone for Box<dyn ParseBlock>
impl Clone for Box<dyn ParseBlock>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read more