pub struct ClientBuilder { /* private fields */ }Expand description
Fluent configuration for Client.
Implementations§
Source§impl ClientBuilder
impl ClientBuilder
pub fn new() -> Self
pub fn api_key(self, api_key: impl Into<String>) -> Self
pub fn base_url(self, base_url: impl Into<String>) -> Self
Sourcepub fn max_retries(self, max_retries: u32) -> Self
pub fn max_retries(self, max_retries: u32) -> Self
Retries for transient failures. Default 2.
Sourcepub fn user_agent(self, user_agent: impl Into<String>) -> Self
pub fn user_agent(self, user_agent: impl Into<String>) -> Self
Appended to the SDK’s own User-Agent.
pub fn default_header(self, name: &str, value: &str) -> Result<Self>
Sourcepub fn http_client(self, http: Client) -> Self
pub fn http_client(self, http: Client) -> Self
Supply a preconfigured reqwest::Client (proxies, custom TLS, tracing).
Sourcepub fn sse_token_in_query(self, enabled: bool) -> Self
pub fn sse_token_in_query(self, enabled: bool) -> Self
Send the API key as ?token= on SSE requests instead of a header.
pub fn build(self) -> Result<Client>
Trait Implementations§
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