Enum jsonpath_rust::JsonPathValue
source · pub enum JsonPathValue<'a, Data> {
Slice(&'a Data, String),
NewValue(Data),
NoValue,
}
Expand description
A result of json path Can be either a slice of initial data or a new generated value(like length of array)
Variants§
Slice(&'a Data, String)
The slice of the initial json data
NewValue(Data)
The new data that was generated from the input data (like length operator)
NoValue
The absent value that indicates the input data is not matched to the given json path (like the absent fields)
Implementations§
source§impl<'a, Data> JsonPathValue<'a, Data>
impl<'a, Data> JsonPathValue<'a, Data>
pub fn has_value(&self) -> bool
pub fn vec_as_data(input: Vec<JsonPathValue<'a, Data>>) -> Vec<&'a Data>
pub fn vec_as_pair( input: Vec<JsonPathValue<'a, Data>> ) -> Vec<(&'a Data, String)>
Trait Implementations§
source§impl<'a, Data: Clone> Clone for JsonPathValue<'a, Data>
impl<'a, Data: Clone> Clone for JsonPathValue<'a, Data>
source§fn clone(&self) -> JsonPathValue<'a, Data>
fn clone(&self) -> JsonPathValue<'a, Data>
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<'a, Data: Debug> Debug for JsonPathValue<'a, Data>
impl<'a, Data: Debug> Debug for JsonPathValue<'a, Data>
source§impl<'a, Data: PartialEq> PartialEq for JsonPathValue<'a, Data>
impl<'a, Data: PartialEq> PartialEq for JsonPathValue<'a, Data>
source§fn eq(&self, other: &JsonPathValue<'a, Data>) -> bool
fn eq(&self, other: &JsonPathValue<'a, Data>) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.impl<'a, Data> StructuralPartialEq for JsonPathValue<'a, Data>
Auto Trait Implementations§
impl<'a, Data> Freeze for JsonPathValue<'a, Data>where
Data: Freeze,
impl<'a, Data> RefUnwindSafe for JsonPathValue<'a, Data>where
Data: RefUnwindSafe,
impl<'a, Data> Send for JsonPathValue<'a, Data>
impl<'a, Data> Sync for JsonPathValue<'a, Data>where
Data: Sync,
impl<'a, Data> Unpin for JsonPathValue<'a, Data>where
Data: Unpin,
impl<'a, Data> UnwindSafe for JsonPathValue<'a, Data>where
Data: UnwindSafe + RefUnwindSafe,
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