pub struct ClientBuilder { /* private fields */ }Expand description
A ClientBuilder is what should be used to construct a Client with custom
configuration.
We default to the production cronback service https://api.cronback.me/ unless CRONBACK_BASE_URL
enviornment variable is defined. Alternatively, the base_url can be used
to override the server url for this particular client instance.
Implementations§
Source§impl ClientBuilder
impl ClientBuilder
Sourcepub fn new() -> Self
pub fn new() -> Self
Construct a new client builder with reasonable defaults. Use
ClientBuilder::build to construct a client.
pub fn base_url<T: IntoUrl>(self, base_url: T) -> Result<Self>
pub fn secret_token(self, secret_token: String) -> Self
Sourcepub fn reqwest_client(self, c: Client) -> Self
pub fn reqwest_client(self, c: Client) -> Self
Use a pre-configured [request::Client] instance instead of creating
our own. This allows customising TLS, timeout, and other low-level http
client configuration options.
Trait Implementations§
Source§impl Clone for ClientBuilder
impl Clone for ClientBuilder
Source§fn clone(&self) -> ClientBuilder
fn clone(&self) -> ClientBuilder
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Default for ClientBuilder
impl Default for ClientBuilder
Source§fn default() -> ClientBuilder
fn default() -> ClientBuilder
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for ClientBuilder
impl !RefUnwindSafe for ClientBuilder
impl Send for ClientBuilder
impl Sync for ClientBuilder
impl Unpin for ClientBuilder
impl !UnwindSafe for ClientBuilder
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