pub struct RestClient { /* private fields */ }Expand description
REST client. Cheap to clone (uses an Arc internally via reqwest::Client).
Implementations§
Source§impl RestClient
impl RestClient
Sourcepub fn new(base_url: impl Into<String>) -> Result<Self, ClientError>
pub fn new(base_url: impl Into<String>) -> Result<Self, ClientError>
Build a REST client pointing at the given base URL.
base_url should be of the form https://devnet-gateway.mtf.exchange (no trailing
slash). Endpoints are appended as /info, /exchange, etc.
§Errors
Returns ClientError::Builder on TLS / config failure.
Sourcepub fn from_http(base_url: impl Into<String>, http: HttpClient) -> Self
pub fn from_http(base_url: impl Into<String>, http: HttpClient) -> Self
Build with a pre-configured reqwest::Client (e.g. proxy, custom TLS roots).
Trait Implementations§
Source§impl Clone for RestClient
impl Clone for RestClient
Source§fn clone(&self) -> RestClient
fn clone(&self) -> RestClient
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl !RefUnwindSafe for RestClient
impl !UnwindSafe for RestClient
impl Freeze for RestClient
impl Send for RestClient
impl Sync for RestClient
impl Unpin for RestClient
impl UnsafeUnpin for RestClient
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more