pub struct Options { /* private fields */ }Expand description
Clickhouse connection options.
Implementations§
Source§impl Options
impl Options
pub fn with_setting<V>(self, name: &str, value: V, is_important: bool) -> Selfwhere
V: Into<SettingType>,
Sourcepub fn with_compression(self) -> Self
pub fn with_compression(self) -> Self
Enable LZ4 compression (compression defaults to none).
Sourcepub fn compression(self, compression: Compression) -> Self
pub fn compression(self, compression: Compression) -> Self
Compression of the data the client sends (defaults to none).
none turns compression off in both directions. With Lz4 or Zstd
the server compresses its replies with the method of its own
network_compression_method setting, and the client reads either.
Sourcepub fn pool_min(self, pool_min: usize) -> Self
pub fn pool_min(self, pool_min: usize) -> Self
Lower bound of opened connections for Pool (defaults to 10).
Sourcepub fn pool_max(self, pool_max: usize) -> Self
pub fn pool_max(self, pool_max: usize) -> Self
Upper bound of opened connections for Pool (defaults to 20).
Sourcepub fn keepalive(self, keepalive: Option<Duration>) -> Self
pub fn keepalive(self, keepalive: Option<Duration>) -> Self
TCP keep alive timeout in milliseconds (defaults to None).
Sourcepub fn ping_before_query(self, ping_before_query: bool) -> Self
pub fn ping_before_query(self, ping_before_query: bool) -> Self
Ping server every time before execute any query. (defaults to true).
Sourcepub fn send_retries(self, send_retries: usize) -> Self
pub fn send_retries(self, send_retries: usize) -> Self
Count of retry to send request to server. (defaults to 3).
Sourcepub fn retry_timeout(self, retry_timeout: Duration) -> Self
pub fn retry_timeout(self, retry_timeout: Duration) -> Self
Amount of time to wait before next retry. (defaults to 5 sec).
Sourcepub fn ping_timeout(self, ping_timeout: Duration) -> Self
pub fn ping_timeout(self, ping_timeout: Duration) -> Self
Timeout for ping (defaults to 500 ms).
Sourcepub fn connection_timeout(self, connection_timeout: Duration) -> Self
pub fn connection_timeout(self, connection_timeout: Duration) -> Self
Timeout for connection (defaults to 500 ms).
Sourcepub fn query_timeout(self, query_timeout: Duration) -> Self
pub fn query_timeout(self, query_timeout: Duration) -> Self
Timeout for query (defaults to 180,000 ms).
Sourcepub fn insert_timeout(self, insert_timeout: Option<Duration>) -> Self
pub fn insert_timeout(self, insert_timeout: Option<Duration>) -> Self
Timeout for insert (defaults to 180,000 ms).
Sourcepub fn execute_timeout(self, execute_timeout: Option<Duration>) -> Self
pub fn execute_timeout(self, execute_timeout: Option<Duration>) -> Self
Timeout for execute (defaults to 180 sec).
Sourcepub fn skip_verify(self, skip_verify: bool) -> Self
pub fn skip_verify(self, skip_verify: bool) -> Self
Skip certificate verification (default is false).
Sourcepub fn certificate(self, certificate: Option<Certificate>) -> Self
pub fn certificate(self, certificate: Option<Certificate>) -> Self
An X509 certificate.
Sourcepub fn settings(self, settings: HashMap<String, SettingValue>) -> Self
pub fn settings(self, settings: HashMap<String, SettingValue>) -> Self
Query settings
Trait Implementations§
impl StructuralPartialEq for Options
Auto Trait Implementations§
impl Forget for Options
impl Freeze for Optionswhere
*const u8 is !null: Freeze,
PhantomData<u8>: Freeze,
*const ArcInner<Vec<CertificateDer<'static>>> is !null: Freeze,
PhantomData<ArcInner<Vec<CertificateDer<'static>>>>: Freeze,
PhantomData<(String, SettingValue)>: Freeze,
PhantomData<Url>: Freeze,
impl Move for Options
impl RefUnwindSafe for Options
impl Send for Optionswhere
RawVecInner: Send,
Arc<Vec<CertificateDer<'static>>>: Send,
RawTable<(String, SettingValue)>: Send,
impl Sync for Optionswhere
RawVecInner: Sync,
Arc<Vec<CertificateDer<'static>>>: Sync,
RawTable<(String, SettingValue)>: Sync,
impl Unpin for Options
impl UnsafeUnpin for Optionswhere
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
*const ArcInner<Vec<CertificateDer<'static>>> is !null: UnsafeUnpin,
PhantomData<ArcInner<Vec<CertificateDer<'static>>>>: UnsafeUnpin,
PhantomData<(String, SettingValue)>: UnsafeUnpin,
PhantomData<Url>: UnsafeUnpin,
impl UnwindSafe for Optionswhere
RawVecInner: UnwindSafe,
Arc<Vec<CertificateDer<'static>>>: UnwindSafe,
HashMap<String, SettingValue>: UnwindSafe,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more