pub trait HttpClient: Send + Sync {
// Required method
fn get_text<'a>(
&'a self,
url: &'a str,
) -> Pin<Box<dyn Future<Output = Result<String, HttpError>> + Send + 'a>>;
// Provided method
fn get_bytes<'a>(
&'a self,
url: &'a str,
) -> Pin<Box<dyn Future<Output = Result<Vec<u8>, HttpError>> + Send + 'a>> { ... }
}Expand description
Re-export framework services (HTTP, URI, etc.) from the dedicated services crate.
Required Methods§
fn get_text<'a>( &'a self, url: &'a str, ) -> Pin<Box<dyn Future<Output = Result<String, HttpError>> + Send + 'a>>
Provided Methods§
fn get_bytes<'a>( &'a self, url: &'a str, ) -> Pin<Box<dyn Future<Output = Result<Vec<u8>, HttpError>> + Send + 'a>>
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".