pub struct ClientConfig {Show 14 fields
pub host: String,
pub token: Option<String>,
pub auth_scheme: String,
pub database: String,
pub org: Option<String>,
pub write_options: WriteOptions,
pub retry: RetryConfig,
pub headers: HeaderMap,
pub ssl_roots_path: Option<String>,
pub proxy: Option<String>,
pub write_timeout: Duration,
pub query_timeout: Duration,
pub idle_connection_timeout: Duration,
pub max_idle_connections: usize,
}Expand description
Configuration for the InfluxDB 3 client.
Construct with ClientConfig::builder() or parse from a connection string /
environment variables with ClientConfig::from_connection_string() /
ClientConfig::from_env().
Fields§
§host: StringInfluxDB host URL (e.g. https://cluster.influxdata.io).
token: Option<String>API token.
auth_scheme: StringAuthentication scheme: "Bearer" (default) or "Token".
database: StringDatabase for all operations. Required; validated at construction time.
org: Option<String>Organization name (used for v2 API compatibility).
write_options: WriteOptionsDefault write options applied to every write call.
retry: RetryConfigDefault retry policy for transient write/query failures. Override per
request with WriteRequest/QueryRequest .retry() / .no_retry().
headers: HeaderMapExtra HTTP headers sent with every request.
ssl_roots_path: Option<String>Path to a PEM file with additional CA roots for TLS verification.
proxy: Option<String>HTTP proxy URL.
write_timeout: DurationRequest timeout for write calls.
query_timeout: DurationTimeout for the Flight channel connect and for collected (.await)
queries. Streaming queries (.stream()) are intentionally unbounded.
idle_connection_timeout: DurationKeep-alive idle connection timeout.
max_idle_connections: usizeMaximum number of idle connections in the pool.
Implementations§
Source§impl ClientConfig
impl ClientConfig
Sourcepub fn builder() -> ClientConfigBuilder
pub fn builder() -> ClientConfigBuilder
Start building a config.
Sourcepub fn from_env() -> Result<Self, Error>
pub fn from_env() -> Result<Self, Error>
Parse INFLUX_HOST, INFLUX_TOKEN, INFLUX_DATABASE, and INFLUX_ORG
from the process environment. INFLUX_HOST and INFLUX_DATABASE are
required; token and org are optional.
Sourcepub fn from_connection_string(cs: &str) -> Result<Self, Error>
pub fn from_connection_string(cs: &str) -> Result<Self, Error>
Parse a URL-formatted connection string, e.g.:
https://cluster.influxdata.io/?token=TOKEN&database=DB&org=ORGdatabase (or bucket) is required; returns an error if absent.
Build the Authorization header value ("Bearer TOKEN" etc.).
Returns Ok(None) when no token is set. Returns an error if the token
contains characters that are invalid in an HTTP header value.
Trait Implementations§
Source§impl Clone for ClientConfig
impl Clone for ClientConfig
Source§fn clone(&self) -> ClientConfig
fn clone(&self) -> ClientConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ClientConfig
impl Debug for ClientConfig
Auto Trait Implementations§
impl Freeze for ClientConfig
impl RefUnwindSafe for ClientConfig
impl Send for ClientConfig
impl Sync for ClientConfig
impl Unpin for ClientConfig
impl UnsafeUnpin for ClientConfig
impl UnwindSafe for ClientConfig
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
T in a tonic::Request