pub trait ScraperResponse {
// Required methods
fn jsonpath(self) -> impl Future<Output = Result<Json>>;
fn json_with_path_to_err<T: DeserializeOwned>(
self,
) -> impl Future<Output = Result<T>>;
fn css_selector(self) -> impl Future<Output = Result<Html>>;
fn xpath(self) -> impl Future<Output = Result<XHtml>>;
fn html(self) -> impl Future<Output = Result<String>>;
}
Expand description
Support extended traits of jsonpath, css selector, and xpath
Required Methods§
Sourcefn jsonpath(self) -> impl Future<Output = Result<Json>>
fn jsonpath(self) -> impl Future<Output = Result<Json>>
Use jsonpath to select the response body
Sourcefn json_with_path_to_err<T: DeserializeOwned>(
self,
) -> impl Future<Output = Result<T>>
fn json_with_path_to_err<T: DeserializeOwned>( self, ) -> impl Future<Output = Result<T>>
works with any existing Serde Deserializer and exposes the chain of field names leading to the error.
- https://crates.io/crates/serde_path_to_error
Sourcefn css_selector(self) -> impl Future<Output = Result<Html>>
fn css_selector(self) -> impl Future<Output = Result<Html>>
Use CSS selector to select the response body
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.