Struct handlebars::RenderContext [−][src]
pub struct RenderContext<'reg> { /* fields omitted */ }
The context of a render call
this context stores information of a render and a writer where generated content is written to.
Methods
impl<'reg> RenderContext<'reg>
[src]
impl<'reg> RenderContext<'reg>
pub fn new(root_template: Option<&'reg String>) -> RenderContext<'reg>
[src]
pub fn new(root_template: Option<&'reg String>) -> RenderContext<'reg>
Create a render context from a Write
pub fn derive(&self) -> RenderContext<'reg>
[src]
pub fn derive(&self) -> RenderContext<'reg>
pub fn new_for_block(&self) -> RenderContext<'reg>
[src]
pub fn new_for_block(&self) -> RenderContext<'reg>
pub fn context(&self) -> Option<Rc<Context>>
[src]
pub fn context(&self) -> Option<Rc<Context>>
pub fn set_context(&mut self, ctx: Context)
[src]
pub fn set_context(&mut self, ctx: Context)
pub fn evaluate<'ctx>(
&self,
context: &'ctx Context,
path: &str,
strict: bool
) -> Result<&'ctx Json, RenderError>
[src]
pub fn evaluate<'ctx>(
&self,
context: &'ctx Context,
path: &str,
strict: bool
) -> Result<&'ctx Json, RenderError>
pub fn evaluate_absolute<'ctx>(
&self,
context: &'ctx Context,
path: &str,
strict: bool
) -> Result<&'ctx Json, RenderError>
[src]
pub fn evaluate_absolute<'ctx>(
&self,
context: &'ctx Context,
path: &str,
strict: bool
) -> Result<&'ctx Json, RenderError>
pub fn get_partial(&self, name: &str) -> Option<&&Template>
[src]
pub fn get_partial(&self, name: &str) -> Option<&&Template>
pub fn set_partial(&mut self, name: String, result: &'reg Template)
[src]
pub fn set_partial(&mut self, name: String, result: &'reg Template)
pub fn set_local_var(&mut self, name: String, value: Json)
[src]
pub fn set_local_var(&mut self, name: String, value: Json)
pub fn clear_local_vars(&mut self)
[src]
pub fn clear_local_vars(&mut self)
pub fn promote_local_vars(&mut self)
[src]
pub fn promote_local_vars(&mut self)
pub fn demote_local_vars(&mut self)
[src]
pub fn demote_local_vars(&mut self)
pub fn get_local_var(&self, name: &str) -> Option<&Json>
[src]
pub fn get_local_var(&self, name: &str) -> Option<&Json>
pub fn is_current_template(&self, p: &str) -> bool
[src]
pub fn is_current_template(&self, p: &str) -> bool
pub fn register_local_helper(
&mut self,
name: &str,
def: Box<HelperDef + 'static>
) -> Option<Rc<Box<HelperDef + 'static>>>
[src]
pub fn register_local_helper(
&mut self,
name: &str,
def: Box<HelperDef + 'static>
) -> Option<Rc<Box<HelperDef + 'static>>>
pub fn unregister_local_helper(&mut self, name: &str)
[src]
pub fn unregister_local_helper(&mut self, name: &str)
pub fn get_local_helper(
&self,
name: &str
) -> Option<Rc<Box<HelperDef + 'static>>>
[src]
pub fn get_local_helper(
&self,
name: &str
) -> Option<Rc<Box<HelperDef + 'static>>>
pub fn get_current_template_name(&self) -> Option<&'reg String>
[src]
pub fn get_current_template_name(&self) -> Option<&'reg String>
pub fn set_current_template_name(&mut self, name: Option<&'reg String>)
[src]
pub fn set_current_template_name(&mut self, name: Option<&'reg String>)
pub fn get_root_template_name(&self) -> Option<&'reg String>
[src]
pub fn get_root_template_name(&self) -> Option<&'reg String>
pub fn set_root_template_name(&mut self, name: Option<&'reg String>)
[src]
pub fn set_root_template_name(&mut self, name: Option<&'reg String>)
pub fn is_disable_escape(&self) -> bool
[src]
pub fn is_disable_escape(&self) -> bool
pub fn set_disable_escape(&mut self, disable: bool)
[src]
pub fn set_disable_escape(&mut self, disable: bool)
pub fn get_path(&self) -> &String
[src]
pub fn get_path(&self) -> &String
pub fn set_path(&mut self, path: String)
[src]
pub fn set_path(&mut self, path: String)
pub fn get_local_path_root(&self) -> &VecDeque<String>
[src]
pub fn get_local_path_root(&self) -> &VecDeque<String>
pub fn push_local_path_root(&mut self, path: String)
[src]
pub fn push_local_path_root(&mut self, path: String)
pub fn pop_local_path_root(&mut self)
[src]
pub fn pop_local_path_root(&mut self)
pub fn push_block_context<T>(&mut self, ctx: &T) -> Result<(), RenderError> where
T: Serialize,
[src]
pub fn push_block_context<T>(&mut self, ctx: &T) -> Result<(), RenderError> where
T: Serialize,
pub fn pop_block_context(&mut self)
[src]
pub fn pop_block_context(&mut self)
pub fn evaluate_in_block_context(
&self,
local_path: &str
) -> Result<Option<&Json>, RenderError>
[src]
pub fn evaluate_in_block_context(
&self,
local_path: &str
) -> Result<Option<&Json>, RenderError>
Trait Implementations
impl<'reg> Clone for RenderContext<'reg>
[src]
impl<'reg> Clone for RenderContext<'reg>
fn clone(&self) -> RenderContext<'reg>
[src]
fn clone(&self) -> RenderContext<'reg>
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 RenderContext<'reg>
[src]
impl<'reg> Debug for RenderContext<'reg>
Auto Trait Implementations
impl<'reg> !Send for RenderContext<'reg>
impl<'reg> !Send for RenderContext<'reg>
impl<'reg> !Sync for RenderContext<'reg>
impl<'reg> !Sync for RenderContext<'reg>