pub struct ClientBuilder { /* private fields */ }Expand description
Builder for Client.
Implementations§
Source§impl ClientBuilder
impl ClientBuilder
Sourcepub fn base_url(self, url: impl AsRef<str>) -> Result<Self>
pub fn base_url(self, url: impl AsRef<str>) -> Result<Self>
Override the base URL. Must be an absolute URL ending in /.
Sourcepub fn http_client(self, client: Client) -> Self
pub fn http_client(self, client: Client) -> Self
Supply a pre-configured reqwest::Client. When set, Self::timeout
is ignored — configure it on the supplied client instead.
Sourcepub fn timeout(self, d: Duration) -> Self
pub fn timeout(self, d: Duration) -> Self
Request timeout (used only when no custom http_client is supplied).
Sourcepub fn retry(self, max: u32, base_delay: Duration) -> Self
pub fn retry(self, max: u32, base_delay: Duration) -> Self
Configure retries with a max attempt count and base delay.
Sourcepub fn retry_config(self, cfg: RetryConfig) -> Self
pub fn retry_config(self, cfg: RetryConfig) -> Self
Supply a fully-specified RetryConfig.
Sourcepub fn stream_reconnects(self, max: u32) -> Self
pub fn stream_reconnects(self, max: u32) -> Self
Set the number of reconnect attempts after a transient stream failure.
Set this to zero when retrying a streamed generation could duplicate
output or cost. The default is three, matching openrouter-go.
Sourcepub fn app_name(self, name: impl Into<String>) -> Self
pub fn app_name(self, name: impl Into<String>) -> Self
App attribution: sent as X-Title by the request layer.
Trait Implementations§
Source§impl Debug for ClientBuilder
impl Debug for ClientBuilder
Source§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 !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