pub struct KalamLinkClientBuilder { /* private fields */ }Expand description
Builder for configuring KalamLinkClient instances.
Implementations§
Source§impl KalamLinkClientBuilder
impl KalamLinkClientBuilder
Sourcepub fn base_url(self, url: impl Into<String>) -> KalamLinkClientBuilder
pub fn base_url(self, url: impl Into<String>) -> KalamLinkClientBuilder
Set the base URL for the KalamDB server
Sourcepub fn timeout(self, timeout: Duration) -> KalamLinkClientBuilder
pub fn timeout(self, timeout: Duration) -> KalamLinkClientBuilder
Set request timeout (for HTTP requests)
Sourcepub fn jwt_token(self, token: impl Into<String>) -> KalamLinkClientBuilder
pub fn jwt_token(self, token: impl Into<String>) -> KalamLinkClientBuilder
Set JWT token authentication
Sourcepub fn auth(self, auth: AuthProvider) -> KalamLinkClientBuilder
pub fn auth(self, auth: AuthProvider) -> KalamLinkClientBuilder
Set authentication provider directly
Sourcepub fn auth_provider(
self,
provider: Arc<dyn DynamicAuthProvider>,
) -> KalamLinkClientBuilder
pub fn auth_provider( self, provider: Arc<dyn DynamicAuthProvider>, ) -> KalamLinkClientBuilder
Set a dynamic (async) authentication provider.
Sourcepub fn max_retries(self, retries: u32) -> KalamLinkClientBuilder
pub fn max_retries(self, retries: u32) -> KalamLinkClientBuilder
Set maximum number of retries for failed requests
Sourcepub fn http_pool_max_idle_per_host(
self,
max_idle_per_host: usize,
) -> KalamLinkClientBuilder
pub fn http_pool_max_idle_per_host( self, max_idle_per_host: usize, ) -> KalamLinkClientBuilder
Set the maximum number of idle HTTP keep-alive connections to retain per host.
Sourcepub fn auth_refresher(
self,
refresher: Arc<dyn Fn() -> Pin<Box<dyn Future<Output = Result<AuthProvider, KalamLinkError>> + Send>> + Send + Sync>,
) -> KalamLinkClientBuilder
pub fn auth_refresher( self, refresher: Arc<dyn Fn() -> Pin<Box<dyn Future<Output = Result<AuthProvider, KalamLinkError>> + Send>> + Send + Sync>, ) -> KalamLinkClientBuilder
Set a custom auth-refresh callback for TOKEN_EXPIRED recovery.
Sourcepub fn timeouts(self, timeouts: KalamLinkTimeouts) -> KalamLinkClientBuilder
pub fn timeouts(self, timeouts: KalamLinkTimeouts) -> KalamLinkClientBuilder
Set comprehensive timeout configuration for all operations
Sourcepub fn connection_options(
self,
options: ConnectionOptions,
) -> KalamLinkClientBuilder
pub fn connection_options( self, options: ConnectionOptions, ) -> KalamLinkClientBuilder
Set connection options for HTTP and WebSocket behavior
Sourcepub fn http_version(self, version: HttpVersion) -> KalamLinkClientBuilder
pub fn http_version(self, version: HttpVersion) -> KalamLinkClientBuilder
Set the HTTP protocol version to use
Sourcepub fn event_handlers(self, handlers: EventHandlers) -> KalamLinkClientBuilder
pub fn event_handlers(self, handlers: EventHandlers) -> KalamLinkClientBuilder
Set connection lifecycle event handlers.
Sourcepub fn build(self) -> Result<KalamLinkClient, KalamLinkError>
pub fn build(self) -> Result<KalamLinkClient, KalamLinkError>
Build the client
Auto Trait Implementations§
impl !RefUnwindSafe for KalamLinkClientBuilder
impl !UnwindSafe for KalamLinkClientBuilder
impl Freeze for KalamLinkClientBuilder
impl Send for KalamLinkClientBuilder
impl Sync for KalamLinkClientBuilder
impl Unpin for KalamLinkClientBuilder
impl UnsafeUnpin for KalamLinkClientBuilder
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