Skip to main content

JsonPick

Struct JsonPick 

Source
pub struct JsonPick<'a> {
    pub doc: &'a str,
    pub path: String,
    pub range: [usize; 2],
}
Expand description

A value inside JSON text.

Fields§

§doc: &'a str

The whole JSON document.

§path: String

The path within the document (the segments after the text’s holder).

§range: [usize; 2]

The selected value’s byte range in doc.

Implementations§

Source§

impl JsonPick<'_>

Source

pub fn value(&self) -> &str

The selected value as JSON text.

Source

pub fn to_json(&self) -> String

{"path":..,"range":[s,e],"value":<JSON>}.

Source

pub fn payload(&self) -> Vec<u8> ⓘ

A string’s unescaped text, any other value verbatim.

Trait Implementations§

Source§

impl<'a> Debug for JsonPick<'a>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'a> Forget for JsonPick<'a>

§

impl<'a> Freeze for JsonPick<'a>

§

impl<'a> Move for JsonPick<'a>

§

impl<'a> RefUnwindSafe for JsonPick<'a>

§

impl<'a> Send for JsonPick<'a>

§

impl<'a> Sync for JsonPick<'a>

§

impl<'a> Unpin for JsonPick<'a>

§

impl<'a> UnsafeUnpin for JsonPick<'a>

§

impl<'a> UnwindSafe for JsonPick<'a>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.