Enum handlebars::ScopedJson
source · pub enum ScopedJson<'rc> {
Constant(&'rc Json),
Derived(Json),
Context(&'rc Json, Vec<String>),
Missing,
}
Expand description
A JSON wrapper designed for handlebars internal use case
- Constant: the JSON value hardcoded into template
- Context: the JSON value referenced in your provided data context
- Derived: the owned JSON value computed during rendering process
Variants§
Implementations§
source§impl<'rc> ScopedJson<'rc>
impl<'rc> ScopedJson<'rc>
pub fn render(&self) -> String
pub fn is_missing(&self) -> bool
pub fn into_derived(self) -> ScopedJson<'rc>
pub fn context_path(&self) -> Option<&Vec<String>>
Trait Implementations§
source§impl<'rc> Clone for ScopedJson<'rc>
impl<'rc> Clone for ScopedJson<'rc>
source§fn clone(&self) -> ScopedJson<'rc>
fn clone(&self) -> ScopedJson<'rc>
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl<'rc> Debug for ScopedJson<'rc>
impl<'rc> Debug for ScopedJson<'rc>
source§impl<'reg: 'rc, 'rc> From<Value> for ScopedJson<'rc>
impl<'reg: 'rc, 'rc> From<Value> for ScopedJson<'rc>
source§fn from(v: Json) -> ScopedJson<'rc>
fn from(v: Json) -> ScopedJson<'rc>
Converts to this type from the input type.