Struct handlebars::Context
source · pub struct Context { /* private fields */ }
Expand description
The context wrap data you render on your templates.
Implementations
sourceimpl Context
impl Context
sourcepub fn wraps<T: Serialize>(e: T) -> Result<Context, RenderError>
pub fn wraps<T: Serialize>(e: T) -> Result<Context, RenderError>
Create a context with given data
Navigate the context with base path and relative path
Typically you will set base path to RenderContext.get_path()
and set relative path to helper argument or so.
If you want to navigate from top level, set the base path to "."
pub fn data(&self) -> &Json
pub fn data_mut(&mut self) -> &mut Json
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Context
impl Send for Context
impl Sync for Context
impl Unpin for Context
impl UnwindSafe for Context
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more