Trait biliapi::requests::BiliResponseExt
source · [−]pub trait BiliResponseExt<T: DeserializeOwned> {
fn bili_data(self) -> Pin<Box<dyn Future<Output = Result<T>> + Send>>ⓘNotable traits for Pin<P>impl<P> Future for Pin<P> where
P: DerefMut,
<P as Deref>::Target: Future, type Output = <<P as Deref>::Target as Future>::Output;
;
}
Expand description
这个 trait 允许直接对 Response
调用 bili_data().await
use biliapi::requests::BiliResponseExt;
let response: reqwest::Response = reqwest::Client::new()
.get("https://example.com")
.send().await?;
let data: i32 = response.bili_data().await?;