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).


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


impl Config[src]

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

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.


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

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

Set the timeout for the Config.


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

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

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

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

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

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

impl<T> Instrument for T[src]

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

impl<T> ToOwned for T where
    T: Clone

type Owned = T

The resulting type after obtaining ownership.

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

type Error = Infallible

The type returned in the event of a conversion error.

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

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>,