Skip to main content

HttpClient

Trait HttpClient 

Source
pub trait HttpClient:
    Send
    + Sync
    + Debug {
    // Required method
    fn get(&self, url: &str) -> Result<String>;
}
Expand description

Trait for simple http get requests. It can be mocked with the static client.

Required Methods§

Source

fn get(&self, url: &str) -> Result<String>

§Errors

This function will return an error if the get request is not successfull.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§