Struct JsonCrawlerBorrowed

Source
pub struct JsonCrawlerBorrowed<'a> { /* private fields */ }

Trait Implementations§

Source§

impl<'a> JsonCrawler for JsonCrawlerBorrowed<'a>

Source§

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

Source§

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

Source§

type IntoIter = JsonCrawlerArrayIterMut<'a>

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

fn get_path(&self) -> String

Source§

fn take_value<T: DeserializeOwned>(&mut self) -> 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: for<'de> Deserialize<'de>>(&self) -> CrawlerResult<T>

Source§

fn borrow_value_pointer<T: for<'de> Deserialize<'de>>( &self, path: impl AsRef<str>, ) -> CrawlerResult<T>

Source§

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

Source§

fn get_source(&self) -> Arc<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

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> 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 = 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.