pub struct PathAndJson<'rc> { /* private fields */ }
Expand description
Json wrapper that holds the Json value and reference path information
Implementations§
Source§impl<'rc> PathAndJson<'rc>
impl<'rc> PathAndJson<'rc>
pub fn new( relative_path: Option<String>, value: ScopedJson<'rc>, ) -> PathAndJson<'rc>
Sourcepub fn relative_path(&self) -> Option<&String>
pub fn relative_path(&self) -> Option<&String>
Returns relative path when the value is referenced
If the value is from a literal, the path is None
Sourcepub fn context_path(&self) -> Option<&Vec<String>>
pub fn context_path(&self) -> Option<&Vec<String>>
Returns full path to this value if any
Sourcepub fn try_get_constant_value(&self) -> Option<&'rc Json>
pub fn try_get_constant_value(&self) -> Option<&'rc Json>
Returns the value, if it is a constant. Otherwise returns None.
Sourcepub fn is_value_missing(&self) -> bool
pub fn is_value_missing(&self) -> bool
Test if value is missing
pub fn render(&self) -> String
Trait Implementations§
Source§impl<'rc> Clone for PathAndJson<'rc>
impl<'rc> Clone for PathAndJson<'rc>
Source§fn clone(&self) -> PathAndJson<'rc>
fn clone(&self) -> PathAndJson<'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 moreAuto Trait Implementations§
impl<'rc> Freeze for PathAndJson<'rc>
impl<'rc> RefUnwindSafe for PathAndJson<'rc>
impl<'rc> Send for PathAndJson<'rc>
impl<'rc> Sync for PathAndJson<'rc>
impl<'rc> Unpin for PathAndJson<'rc>
impl<'rc> UnwindSafe for PathAndJson<'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