Struct JsonCrawlerOwned

Source
pub struct JsonCrawlerOwned { /* private fields */ }

Implementations§

Source§

impl JsonCrawlerOwned

Source

pub fn new(source: String, json: Value) -> Self

Create a new JsonCrawler, where ‘json’ is the serde_json::Value that you wish to crawl and ‘source’ represents a serialized copy of the same serde_json::Value.

Trait Implementations§

Source§

impl Clone for JsonCrawlerOwned

Source§

fn clone(&self) -> JsonCrawlerOwned

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for JsonCrawlerOwned

Source§

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

Formats the value using the given formatter. Read more
Source§

impl JsonCrawler for JsonCrawlerOwned

Source§

type BorrowTo<'a> = JsonCrawlerBorrowed<'a> where Self: 'a

Source§

type IterMut<'a> = JsonCrawlerArrayIterMut<'a> where Self: 'a

Source§

type IntoIter = JsonCrawlerArrayIntoIter

Source§

fn try_into_iter(self) -> CrawlerResult<Self::IntoIter>

Source§

fn try_iter_mut(&mut self) -> CrawlerResult<Self::IterMut<'_>>

Source§

fn navigate_pointer(self, new_path: impl AsRef<str>) -> CrawlerResult<Self>

Source§

fn navigate_index(self, index: usize) -> CrawlerResult<Self>

Source§

fn borrow_pointer( &mut self, path: impl AsRef<str>, ) -> CrawlerResult<Self::BorrowTo<'_>>

Source§

fn borrow_index(&mut self, index: usize) -> CrawlerResult<Self::BorrowTo<'_>>

Source§

fn borrow_mut(&mut self) -> Self::BorrowTo<'_>

Source§

fn take_value<T: DeserializeOwned>(&mut self) -> CrawlerResult<T>

Source§

fn take_value_pointer<T: DeserializeOwned>( &mut self, path: impl AsRef<str>, ) -> CrawlerResult<T>

Source§

fn take_value_pointers<T: DeserializeOwned, S: AsRef<str>>( &mut self, paths: &[S], ) -> CrawlerResult<T>

For use when you want to try and take value that could be at multiple valid locations. Returns an error message that notes that all valid locations were attempted. Read more
Source§

fn borrow_value<T: DeserializeOwned>(&self) -> CrawlerResult<T>

Source§

fn borrow_value_pointer<T: DeserializeOwned>( &self, path: impl AsRef<str>, ) -> CrawlerResult<T>

Source§

fn path_exists(&self, path: &str) -> bool

Source§

fn get_source(&self) -> Arc<String>

Source§

fn get_path(&self) -> String

Source§

fn try_expect<F, O>(&mut self, msg: impl ToString, f: F) -> CrawlerResult<O>
where F: FnOnce(&mut Self) -> CrawlerResult<Option<O>>,

For use when you want to apply some operations that return Option, but still return an error with context if they fail. For convenience, closure return type is fallible, allowing you to see the cause of the error at the failure point as well, if you have it. Read more
Source§

fn take_and_parse_str<F: FromStr>(&mut self) -> CrawlerResult<F>
where F::Err: Display,

Take the value as a String, and apply FromStr to return the desired type.
Source§

fn try_functions<O>( &mut self, functions: Vec<fn(&mut Self) -> CrawlerResult<O>>, ) -> CrawlerResult<O>

Try to apply each function in a list of functions, returning the first Ok result, or the last Err result if none returned Ok. Read more
Source§

impl PartialEq for JsonCrawlerOwned

Source§

fn eq(&self, other: &JsonCrawlerOwned) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl StructuralPartialEq for JsonCrawlerOwned

Auto Trait Implementations§

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

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

Source§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.