Struct handlebars::BlockContext [−][src]
pub struct BlockContext<'reg> { /* fields omitted */ }
Expand description
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]
pub fn new() -> BlockContext<'reg>
[src]create a new BlockContext
with default data
pub fn set_local_var(&mut self, name: &str, value: Json)
[src]
pub fn set_local_var(&mut self, name: &str, value: Json)
[src]set a local variable into current scope
pub fn get_local_var(&self, name: &str) -> Option<&Json>
[src]
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]
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]
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]
pub fn base_value(&self) -> Option<&Json>
[src]borrow the base value
pub fn set_base_value(&mut self, value: Json)
[src]
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]
pub fn get_block_param(
&self,
block_param_name: &str
) -> Option<&BlockParamHolder>
[src]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]
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]
fn clone(&self) -> BlockContext<'reg>
[src]Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]Performs copy-assignment from source
. Read more
impl<'reg> Debug for BlockContext<'reg>
[src]
impl<'reg> Debug for BlockContext<'reg>
[src]impl<'reg> Default for BlockContext<'reg>
[src]
impl<'reg> Default for BlockContext<'reg>
[src]fn default() -> BlockContext<'reg>
[src]
fn default() -> BlockContext<'reg>
[src]Returns the “default value” for a type. Read more
Auto Trait Implementations
impl<'reg> RefUnwindSafe for BlockContext<'reg>
impl<'reg> Send for BlockContext<'reg>
impl<'reg> Sync for BlockContext<'reg>
impl<'reg> Unpin for BlockContext<'reg>
impl<'reg> UnwindSafe for BlockContext<'reg>
Blanket Implementations
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]pub fn borrow_mut(&mut self) -> &mut T
[src]
pub fn borrow_mut(&mut self) -> &mut T
[src]Mutably borrows from an owned value. Read more
impl<T> ToOwned for T where
T: Clone,
[src]
impl<T> ToOwned for T where
T: Clone,
[src]type Owned = T
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn to_owned(&self) -> T
[src]Creates owned data from borrowed data, usually by cloning. Read more
pub fn clone_into(&self, target: &mut T)
[src]
pub fn clone_into(&self, target: &mut T)
[src]🔬 This is a nightly-only experimental API. (toowned_clone_into
)
recently added
Uses borrowed data to replace owned data, usually by cloning. Read more