pub enum ScopedJson<'rc> {
Constant(&'rc Value),
Derived(Value),
Context(&'rc Value, 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<'rc> From<Value> for ScopedJson<'rc>
impl<'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.
Auto Trait Implementations§
impl<'rc> Freeze for ScopedJson<'rc>
impl<'rc> RefUnwindSafe for ScopedJson<'rc>
impl<'rc> Send for ScopedJson<'rc>
impl<'rc> Sync for ScopedJson<'rc>
impl<'rc> Unpin for ScopedJson<'rc>
impl<'rc> UnwindSafe for ScopedJson<'rc>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)