pub struct ClientBuilder { /* private fields */ }Expand description
Builder for a Client. base_url and token are required; the HTTP
client is optional so a caller can supply its own pool, timeouts, or proxy
configuration instead of taking reqwest’s defaults.
Implementations§
Source§impl ClientBuilder
impl ClientBuilder
Sourcepub fn token(self, token: impl Into<String>) -> Self
pub fn token(self, token: impl Into<String>) -> Self
The shared bearer token every /v1 route requires.
Sourcepub fn http_client(self, http: Client) -> Self
pub fn http_client(self, http: Client) -> Self
Use this reqwest::Client — the caller’s own connection pool, timeouts,
redirect policy or proxy — instead of a freshly built default one.
pub fn build(self) -> Result<Client>
Trait Implementations§
Source§impl Clone for ClientBuilder
impl Clone for ClientBuilder
Source§impl Debug for ClientBuilder
impl Debug for ClientBuilder
Auto Trait Implementations§
impl !RefUnwindSafe for ClientBuilder
impl !UnwindSafe for ClientBuilder
impl Freeze for ClientBuilder
impl Send for ClientBuilder
impl Sync for ClientBuilder
impl Unpin for ClientBuilder
impl UnsafeUnpin 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