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.
§Type Parameters
'a- Lifetime of an object key borrowed from the traversed JSON tree.
§Examples
use qubit_json::value::traverse::JsonTreeContext;
use qubit_json::value::traverse::JsonTreeLocation;
let key = "items";
let context = JsonTreeContext {
depth: 2,
location: JsonTreeLocation::ObjectValue { key },
};
assert_eq!(context.depth, 2);
assert_eq!(context.location, JsonTreeLocation::ObjectValue { key });Fields§
§depth: usizeRoot-inclusive depth; the root is always at depth one.
location: JsonTreeLocation<'a>Root marker or location of this node in its immediate parent.
Trait Implementations§
Source§impl<'a> Clone for JsonTreeContext<'a>
impl<'a> Clone for JsonTreeContext<'a>
impl<'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> Forget for JsonTreeContext<'a>
impl<'a> Freeze for JsonTreeContext<'a>
impl<'a> Move 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