Select 丢弃任何编码信息,这充其量是次优的 error[E0277]: the trait bound `reqwest::Response: std::io::Read` is not satisfied --> src/main.rs:19:25
丢弃任何编码信息,这充其量是次优的Select 丢弃任何编码信息,这充其量是次优的 error[E0277]: the trait bound `reqwest::Response: std::io::Read` is not satisfied --> src/main.rs:19:25 ,select,rust,reqwest,Select,Rust,Reqwest,丢弃任何编码信息,这充其量是次优的 error[E0277]: the trait bound `reqwest::Response: std::io::Read` is not satisfied --> src/main.rs:19:25 | 19 | Document::from_read(res)? | ^^^ the trait `std::io::Read` is not implemented for `
error[E0277]: the trait bound `reqwest::Response: std::io::Read` is not satisfied
--> src/main.rs:19:25
|
19 | Document::from_read(res)?
| ^^^ the trait `std::io::Read` is not implemented for `reqwest::Response`
|
::: /root/.cargo/registry/src/github.com-1ecc6299db9ec823/select-0.4.3/src/document.rs:31:25
|
31 | pub fn from_read<R: io::Read>(mut readable: R) -> io::Result<Document> {
| -------- required by this bound in `select::document::Document::from_read`
#[macro_use]
extern crate error_chain;
extern crate reqwest;
extern crate select;
use select::document::Document;
use select::predicate::Name;
error_chain! {
foreign_links {
ReqError(reqwest::Error);
IoError(std::io::Error);
}
}
fn main() -> Result<()> {
let res = reqwest::get("https://www.rust-lang.org/en-US/").await?;
Document::from_read(res)?
.find(Name("a"))
.filter_map(|n| n.attr("href"))
.for_each(|x| println!("{}", x));
Ok(())
}