Skip to main content

IgniteClientConfig

Struct IgniteClientConfig 

Source
pub struct IgniteClientConfig {
Show 13 fields pub address: String, pub addresses: Vec<String>, pub partition_awareness: Option<bool>, pub endpoint_discovery: Option<bool>, pub data_center_id: Option<String>, pub username: Option<String>, pub password: Option<String>, pub max_pool_size: usize, pub connect_timeout: Duration, pub request_timeout: Duration, pub page_size: usize, pub use_tls: bool, pub tls_accept_invalid_certs: bool,
}

Fields§

§address: String

“host:port” address of the primary cluster node (first of Self::addresses).

§addresses: Vec<String>

All configured “host:port” node addresses. Partition-aware routing connects to each and routes keys to their owning node. A single-element list reproduces the original single-node behaviour.

§partition_awareness: Option<bool>

Partition awareness toggle. None = auto (enabled when ≥ 2 addresses are configured and the server supports it); Some(b) forces it.

§endpoint_discovery: Option<bool>

Server endpoint discovery toggle. None = auto (on); Some(b) forces it. Only has effect when partition awareness is enabled — the client then learns cluster nodes not in Self::addresses and routes to them.

§data_center_id: Option<String>

This client’s data-center id (DC_AWARE). When set and the server supports DC_AWARE, read-only ops are routed to a partition owner in this data center (a backup) instead of the primary. None = no DC affinity (reads go to the primary).

§username: Option<String>§password: Option<String>§max_pool_size: usize§connect_timeout: Duration

Maximum time allowed for TCP connect + TLS/handshake (also used as deadpool wait and create timeout). Default: 10 s.

§request_timeout: Duration

Per-request response deadline applied in every send_and_receive call. Default: 30 s.

§page_size: usize

Number of rows fetched per server round-trip in SQL queries. A smaller value reduces memory pressure but increases round-trips. Default: 1024.

§use_tls: bool

Connect using TLS/SSL. Default: false.

§tls_accept_invalid_certs: bool

Skip server certificate verification — for development / self-signed certificates only. Has no effect when use_tls is false. Default: false.

Implementations§

Source§

impl IgniteClientConfig

Source

pub fn new(address: impl Into<String>) -> Self

Source

pub fn with_addresses(self, addresses: Vec<String>) -> Self

Configure the full set of cluster node addresses for partition-aware routing. The first entry becomes the primary Self::address. An empty list is ignored (the existing address is retained).

Source

pub fn with_partition_awareness(self, enabled: bool) -> Self

Force partition awareness on or off, overriding the auto default.

Source

pub fn with_endpoint_discovery(self, enabled: bool) -> Self

Force server endpoint discovery on or off, overriding the auto default. Only effective when partition awareness is enabled.

Source

pub fn with_data_center_id(self, dc_id: impl Into<String>) -> Self

Set this client’s data-center id for DC_AWARE read-from-backup routing.

Source

pub fn with_auth( self, username: impl Into<String>, password: impl Into<String>, ) -> Self

Source

pub fn with_pool_size(self, size: usize) -> Self

Source

pub fn with_connect_timeout(self, duration: Duration) -> Self

Override the TCP connect + handshake timeout (default: 10 s).

Source

pub fn with_request_timeout(self, duration: Duration) -> Self

Override the per-request response timeout (default: 30 s).

Source

pub fn with_page_size(self, page_size: usize) -> Self

Override the SQL query page size (rows per server round-trip). Default: 1024. Use a smaller value (e.g. 1) to force multi-page fetches in tests, or a larger value to reduce round-trips for large result sets.

Source

pub fn with_tls(self) -> Self

Enable TLS for all connections. Default: false.

Source

pub fn with_tls_accept_invalid_certs(self) -> Self

Skip server certificate verification (development / self-signed certs only). Has no effect unless with_tls() is also called.

Trait Implementations§

Source§

impl Clone for IgniteClientConfig

Source§

fn clone(&self) -> IgniteClientConfig

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for IgniteClientConfig

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Custom impl so the password is never printed in plaintext. Any logging of a config object will show password: Some("[REDACTED]").

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more