Requester

Trait Requester 

Source
pub trait Requester {
    // Required method
    fn get_json<T: DeserializeOwned>(
        &self,
        url: &str,
    ) -> Pin<Box<dyn Future<Output = Result<T, Box<dyn Error>>> + '_>>;
}
Expand description

An abstract HTTP client.

Used in ConfigBuilder to help fetching bilibili config.

Required Methods§

Source

fn get_json<T: DeserializeOwned>( &self, url: &str, ) -> Pin<Box<dyn Future<Output = Result<T, Box<dyn Error>>> + '_>>

Make a GET request to the url and try to deserialize the response body as JSON.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§