[][src]Struct handlebars::BlockContext

pub struct BlockContext<'reg: 'rc, 'rc> { /* fields omitted */ }

A data structure holds contextual data for current block scope.

Implementations

impl<'reg: 'rc, 'rc> BlockContext<'reg, 'rc>[src]

pub fn new() -> BlockContext<'reg, 'rc>[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 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]

Set a block parameter into this block.

Trait Implementations

impl<'reg: 'rc, 'rc> Clone for BlockContext<'reg, 'rc>[src]

impl<'reg: 'rc, 'rc> Debug for BlockContext<'reg, 'rc>[src]

impl<'reg: 'rc, 'rc> Default for BlockContext<'reg, 'rc>[src]

Auto Trait Implementations

impl<'reg, 'rc> RefUnwindSafe for BlockContext<'reg, 'rc>

impl<'reg, 'rc> Send for BlockContext<'reg, 'rc>

impl<'reg, 'rc> Sync for BlockContext<'reg, 'rc>

impl<'reg, 'rc> Unpin for BlockContext<'reg, 'rc>

impl<'reg, 'rc> UnwindSafe for BlockContext<'reg, 'rc>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> SendSync for T where
    T: Send + Sync

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.