pub struct ClientBuilder { /* private fields */ }Expand description
Configures and builds a TaleaClient. Created by
TaleaClient::builder; finish with ClientBuilder::build.
Implementations§
Source§impl ClientBuilder
impl ClientBuilder
Sourcepub fn bearer_token(self, token: impl Into<String>) -> Self
pub fn bearer_token(self, token: impl Into<String>) -> Self
Send Authorization: Bearer <token> on every request (matches the
server’s TALEA_API_TOKEN). Without it the client only works
against a server running in open dev mode.
Sourcepub fn timeout(self, timeout: Duration) -> Self
pub fn timeout(self, timeout: Duration) -> Self
Per-request timeout (default 30s). Not applied to SSE subscriptions.
Sourcepub fn retry(self, retry: RetryPolicy) -> Self
pub fn retry(self, retry: RetryPolicy) -> Self
Retry policy for 503/408/transport failures (default: 3 attempts,
exponential 200ms..5s, honoring Retry-After). Safe for every
operation; use RetryPolicy::none to surface failures immediately.
Sourcepub fn with_http_client(self, client: Client) -> Self
pub fn with_http_client(self, client: Client) -> Self
Bring your own reqwest client (proxies, TLS config, …). Do NOT set
a global timeout on it — that would kill SSE; use .timeout() here.
Sourcepub fn build(self) -> ApiResult<TaleaClient>
pub fn build(self) -> ApiResult<TaleaClient>
Validate the base URL and construct the client. Fails with
ApiError::Transport on an unparseable URL; no network I/O happens
until the first request.