Struct tikv_client::Config[][src]

pub struct Config {
    pub ca_path: Option<PathBuf>,
    pub cert_path: Option<PathBuf>,
    pub key_path: Option<PathBuf>,
    pub timeout: Duration,
}

The configuration for either a raw::Client or a transaction::Client.

Because TiKV is managed by a PD cluster, the endpoints for PD must be provided, not the TiKV nodes.

It’s important to include more than one PD endpoint (include all, if possible!) This helps avoid having a single point of failure.

By default, this client will use an insecure connection over instead of one protected by Transport Layer Security (TLS). Your deployment may have chosen to rely on security measures such as a private network, or a VPN layer to provide secure transmission.

To use a TLS secured connection, use the with_security function to set the required parameters.

TiKV does not currently offer encrypted storage (or encryption-at-rest).

Fields

ca_path: Option<PathBuf>cert_path: Option<PathBuf>key_path: Option<PathBuf>timeout: Duration

Implementations

impl Config[src]

pub fn with_security(
    self,
    ca_path: impl Into<PathBuf>,
    cert_path: impl Into<PathBuf>,
    key_path: impl Into<PathBuf>
) -> Self
[src]

Set the certificate authority, certificate, and key locations for the Config.

By default, TiKV connections do not utilize transport layer security. Enable it by setting these values.

Examples

let config = Config::default().with_security("root.ca", "internal.cert", "internal.key");

pub fn timeout(self, timeout: Duration) -> Self[src]

Set the timeout for the Config.

Examples

let config = Config::default().timeout(Duration::from_secs(10));

Trait Implementations

impl Clone for Config[src]

impl Debug for Config[src]

impl Default for Config[src]

impl<'de> Deserialize<'de> for Config where
    Config: Default
[src]

impl PartialEq<Config> for Config[src]

impl Serialize for Config[src]

impl StructuralPartialEq for Config[src]

Auto Trait Implementations

impl RefUnwindSafe for Config

impl Send for Config

impl Sync for Config

impl Unpin for Config

impl UnwindSafe for Config

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

impl<T> From<T> for T[src]

impl<T> Instrument for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>, 
[src]