Struct handlebars::BlockContext [−][src]
pub struct BlockContext<'reg> { /* fields omitted */ }A data structure holds contextual data for current block scope.
Implementations
impl<'reg> BlockContext<'reg>[src]
impl<'reg> BlockContext<'reg>[src]pub fn new() -> BlockContext<'reg>[src]
create a new BlockContext with default data
pub fn set_local_var(&mut self, name: String, value: Json)[src]
set a local variable into current scope
pub fn get_local_var(&self, name: &str) -> Option<&Json>[src]
get a local variable from current scope
pub fn base_path(&self) -> &Vec<String>[src]
borrow a reference to current scope’s base path all paths inside this block will be relative to this path
pub fn base_path_mut(&mut self) -> &mut Vec<String>[src]
borrow a mutable reference to the base path
pub fn base_value(&self) -> Option<&Json>[src]
borrow the base value
pub fn set_base_value(&mut self, value: Json)[src]
set the base value
pub fn get_block_param(
&self,
block_param_name: &str
) -> Option<&BlockParamHolder>[src]
&self,
block_param_name: &str
) -> Option<&BlockParamHolder>
Get a block parameter from this block. Block parameters needed to be supported by the block helper. The typical syntax for block parameter is:
{{#myblock param1 as |block_param1|}}
...
{{/myblock}}
pub fn set_block_params(&mut self, block_params: BlockParams<'reg>)[src]
Set a block parameter into this block.
Trait Implementations
impl<'reg> Clone for BlockContext<'reg>[src]
impl<'reg> Clone for BlockContext<'reg>[src]fn clone(&self) -> BlockContext<'reg>[src]
pub fn clone_from(&mut self, source: &Self)1.0.0[src]
impl<'reg> Default for BlockContext<'reg>[src]
impl<'reg> Default for BlockContext<'reg>[src]