use crate::Config;
use crate::service::transport::HttpTransport;
use std::ops::Deref;
use std::sync::Arc;
pub(crate) struct HttpClient {
transport: Arc<HttpTransport>,
}
impl HttpClient {
pub fn new(config: Config) -> HttpClient {
HttpClient {
transport: Arc::new(HttpTransport::new(config)),
}
}
}
impl Clone for HttpClient {
fn clone(&self) -> Self {
HttpClient {
transport: Arc::clone(&self.transport),
}
}
}
impl Deref for HttpClient {
type Target = Arc<HttpTransport>;
fn deref(&self) -> &Self::Target {
&self.transport
}
}