use crate::Client;
use crate::swarm::Error;
#[derive(Clone, Debug)]
pub struct DevClient {
inner: Client,
}
impl DevClient {
pub fn new(url: &str) -> Result<Self, Error> {
Ok(Self {
inner: Client::new(url)?,
})
}
pub fn with_http_client(url: &str, http: reqwest::Client) -> Result<Self, Error> {
Ok(Self {
inner: Client::with_http_client(url, http)?,
})
}
pub fn client(&self) -> &Client {
&self.inner
}
pub fn into_client(self) -> Client {
self.inner
}
}
impl std::ops::Deref for DevClient {
type Target = Client;
fn deref(&self) -> &Self::Target {
&self.inner
}
}