• [编程语言] Rust dyn 关键字 2021-06-25 14:17:54

    关键字 dyn dyn是trait对象类型的前缀。 use std::collections::HashMap; fn main() -> Result<(), Box<dyn std::error::Error>> { let resp = reqwest::blocking::get("https://httpbin.org/ip")? .json::<HashMap<String, String>>()?;