Trait json_crawler::JsonCrawlerIterator
source · pub trait JsonCrawlerIterator: Iteratorwhere
Self::Item: JsonCrawler,{
// Required methods
fn find_path(self, path: impl AsRef<str>) -> CrawlerResult<Self::Item>;
fn get_context(&self) -> JsonCrawlerArrayIterContext;
fn try_last(self) -> CrawlerResult<Self::Item>;
}
Expand description
Iterator extension trait containing special methods for Json Crawler iterators to help with error handling.
Required Methods§
sourcefn find_path(self, path: impl AsRef<str>) -> CrawlerResult<Self::Item>
fn find_path(self, path: impl AsRef<str>) -> CrawlerResult<Self::Item>
Return the first crawler found at path
, or error.
sourcefn get_context(&self) -> JsonCrawlerArrayIterContext
fn get_context(&self) -> JsonCrawlerArrayIterContext
Get a context object that can be used to generate error types that are unable to be expressed declaratively.
§Note
This allocates internally, to allow it to outlive the original iterator.
sourcefn try_last(self) -> CrawlerResult<Self::Item>
fn try_last(self) -> CrawlerResult<Self::Item>
Return the last item of the array, or return an error with context.
Object Safety§
This trait is not object safe.