pub struct Client { /* private fields */ }Expand description
An asynchronous client for a cronback API service.
The client has various configuration options, but has reasonable defaults
that should suit most use-cases. To configure a client, use
Client::builder() or ClientBuilder::new()
a Client manages an internal connection pool, it’s designed to be created
once and reused (via Client::clone()). You do not need to wrap
Client in Rc or [Arc] to reuse it.
Implementations§
Source§impl Client
impl Client
Sourcepub fn new() -> Self
pub fn new() -> Self
Constructs a new client with the default configuration. This is not
the recommended way to construct a client. We recommend using
Client::builder().build() instead.
§Panics
This method panics if TLS backend cannot be initialised, or the
underlying resolver cannot load the system configuration. Use
Client::builder() if you wish to handle the failure as an
crate::Error instead of panicking.
Sourcepub fn builder() -> ClientBuilder
pub fn builder() -> ClientBuilder
Creates a ClientBuilder to configure a Client.
This is the same as ClientBuilder::new().