Struct handlebars::BlockContext [−][src]
A data structure holds contextual data for current block scope.
Implementations
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]
fn clone(&self) -> BlockContext<'reg>
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl<'reg> Debug for BlockContext<'reg>
[src]
impl<'reg> Default for BlockContext<'reg>
[src]
fn default() -> BlockContext<'reg>
[src]
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> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,