Trait json_crawler::JsonCrawlerIterator

source ·
pub trait JsonCrawlerIterator: Iterator
where 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§

source

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

Return the first crawler found at path, or error.

source

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.

source

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.

Implementors§