pub struct ClientConfigBuilder { /* private fields */ }Expand description
Fluent builder for ClientConfig.
Implementations§
Source§impl ClientConfigBuilder
impl ClientConfigBuilder
pub fn token(self, token: impl Into<String>) -> Self
pub fn token_opt(self, token: Option<String>) -> Self
Sourcepub fn auth_scheme(self, scheme: impl Into<String>) -> Self
pub fn auth_scheme(self, scheme: impl Into<String>) -> Self
"Bearer" (default) or "Token".
pub fn database(self, db: impl Into<String>) -> Self
pub fn org(self, org: impl Into<String>) -> Self
pub fn org_opt(self, org: Option<String>) -> Self
pub fn write_options(self, opts: WriteOptions) -> Self
Sourcepub fn retry(self, retry: RetryConfig) -> Self
pub fn retry(self, retry: RetryConfig) -> Self
Set the default retry policy for transient write/query failures.
Sourcepub fn header(self, key: impl Into<String>, value: impl Into<String>) -> Self
pub fn header(self, key: impl Into<String>, value: impl Into<String>) -> Self
Add a single extra HTTP header sent with every request.
The name and value are validated in build, so an
invalid header is reported as an error rather than panicking here.
pub fn ssl_roots_path(self, path: impl Into<String>) -> Self
pub fn proxy(self, proxy: impl Into<String>) -> Self
pub fn write_timeout(self, dur: Duration) -> Self
pub fn query_timeout(self, dur: Duration) -> Self
pub fn idle_connection_timeout(self, dur: Duration) -> Self
pub fn max_idle_connections(self, n: usize) -> Self
Sourcepub fn build(self) -> Result<ClientConfig, Error>
pub fn build(self) -> Result<ClientConfig, Error>
Validate and produce the final ClientConfig.
Returns an error if host or database were not set.
Trait Implementations§
Source§impl Debug for ClientConfigBuilder
impl Debug for ClientConfigBuilder
Source§impl Default for ClientConfigBuilder
impl Default for ClientConfigBuilder
Source§fn default() -> ClientConfigBuilder
fn default() -> ClientConfigBuilder
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for ClientConfigBuilder
impl RefUnwindSafe for ClientConfigBuilder
impl Send for ClientConfigBuilder
impl Sync for ClientConfigBuilder
impl Unpin for ClientConfigBuilder
impl UnsafeUnpin for ClientConfigBuilder
impl UnwindSafe for ClientConfigBuilder
Blanket Implementations§
impl<T> Allocation for T
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request