pub struct JsonTreeContext<'a> {
pub depth: usize,
pub location: JsonTreeLocation<'a>,
}Expand description
Describes the root-inclusive depth and parent location of a JSON node.
§Examples
use qubit_json::value::traverse::{JsonTreeContext, JsonTreeLocation};
let context = JsonTreeContext {
depth: 1,
location: JsonTreeLocation::Root,
};
assert_eq!(context.depth, 1);Fields§
§depth: usizeRoot-inclusive depth; the root is always at depth one.
location: JsonTreeLocation<'a>Location of this node in its immediate parent.
Trait Implementations§
Source§impl<'a> Clone for JsonTreeContext<'a>
impl<'a> Clone for JsonTreeContext<'a>
Source§fn clone(&self) -> JsonTreeContext<'a>
fn clone(&self) -> JsonTreeContext<'a>
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl<'a> Copy for JsonTreeContext<'a>
Source§impl<'a> Debug for JsonTreeContext<'a>
impl<'a> Debug for JsonTreeContext<'a>
impl<'a> Eq for JsonTreeContext<'a>
Source§impl<'a> Hash for JsonTreeContext<'a>
impl<'a> Hash for JsonTreeContext<'a>
Source§impl<'a> PartialEq for JsonTreeContext<'a>
impl<'a> PartialEq for JsonTreeContext<'a>
impl<'a> StructuralPartialEq for JsonTreeContext<'a>
Auto Trait Implementations§
impl<'a> Freeze for JsonTreeContext<'a>
impl<'a> RefUnwindSafe for JsonTreeContext<'a>
impl<'a> Send for JsonTreeContext<'a>
impl<'a> Sync for JsonTreeContext<'a>
impl<'a> Unpin for JsonTreeContext<'a>
impl<'a> UnsafeUnpin for JsonTreeContext<'a>
impl<'a> UnwindSafe for JsonTreeContext<'a>
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