Skip to content

Commit 80f648b

Browse files
committed
Derive Clone and implement {url, client} for AsyncClient
1 parent cb45d36 commit 80f648b

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

src/async.rs

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ use reqwest::{Client, StatusCode};
2626

2727
use crate::{BlockStatus, BlockSummary, Builder, Error, MerkleProof, OutputStatus, Tx, TxStatus};
2828

29-
#[derive(Debug)]
29+
#[derive(Debug, Clone)]
3030
pub struct AsyncClient {
3131
url: String,
3232
client: Client,
@@ -323,4 +323,14 @@ impl AsyncClient {
323323
.json()
324324
.await?)
325325
}
326+
327+
/// Get the underlying base URL.
328+
pub fn url(&self) -> &str {
329+
&self.url
330+
}
331+
332+
/// Get the underlying [`Client`].
333+
pub fn client(&self) -> &Client {
334+
&self.client
335+
}
326336
}

0 commit comments

Comments
 (0)