Trait biliapi::requests::BiliResponseExt[][src]

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: Unpin + 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?;

Required methods

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: Unpin + DerefMut,
    <P as Deref>::Target: Future
type Output = <<P as Deref>::Target as Future>::Output;
[src]

Implementations on Foreign Types

impl<T: DeserializeOwned> BiliResponseExt<T> for Response[src]

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: Unpin + DerefMut,
    <P as Deref>::Target: Future
type Output = <<P as Deref>::Target as Future>::Output;
[src]

Implementors