pub trait Document: Send + Sync {
// Required method
fn links<'a>(
&'a self,
selector: Option<&'a str>,
) -> BoxFuture<'a, Result<DocumentLinks>>;
}Expand description
A live rendered document, separate from a fetched response snapshot.
Methods return boxed futures to make this optional capability object safe. Ordinary HTTP sessions do not implement it or allocate these futures. Captures observe the current DOM and must not scroll or mutate it.
Required Methods§
Sourcefn links<'a>(
&'a self,
selector: Option<&'a str>,
) -> BoxFuture<'a, Result<DocumentLinks>>
fn links<'a>( &'a self, selector: Option<&'a str>, ) -> BoxFuture<'a, Result<DocumentLinks>>
Captures links and their visibility together, in document order.
selector narrows <a href> and <area href> links using CSS.
§Errors
Returns an error if the selector is invalid, no page has been fetched, or the document cannot be read.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".