[][src]Struct eventstore::ClientSettings

pub struct ClientSettings { /* fields omitted */ }

Gathers all the settings related to a gRPC client with an EventStoreDB database. ClientSettings can only be created when parsing a connection string.

let setts = "esdb://localhost:1234?tls=false".parse::<ClientSettings>()?;

You can declare a single-node or a cluster-mode client while only using a connection string. For example, you can define a cluster-mode client based on a fixed set of gossip seeds:

let setts = "esdb://localhost:1111,localhost:2222,localhost:3333".parse::<ClientSettings>()?;

Same example except we are using DNS discovery this time. The client will perform SRV queries to resolve all the node associated to that domain:

let setts = "esdb+discover://mydomain:1234".parse::<ClientSettings>()?;

ClientSettings supports a wide range of settings. If a setting is not mentioned in the connection string, that setting default value is used.

  • maxDiscoverAttempts: default 3. Maximum number of DNS discovery attempts before the connection gives up. TODO - Current behavior keeps retrying ensdlessly.

  • discoveryInterval: default 500ms. Waiting period between discovery attempts.

  • gossipTimeout: default 3s: Waiting period before a gossip request timeout. TODO - Current behavior doesn't timeout at all.

  • tls: default true. Use a secure connection.

  • tlsVerifyCert: default true. When using a secure connection, perform a certification verification.

  • nodePreference: default random. When in a cluster connection, indicates what type of node a connection should pick. Keep in mind that's best effort. Supported values are:

    • leader
    • random
    • follower
    • readOnlyReplica
  • throwOnAppendFailure: default true. If the client raise an exception when facing a WrongExpectedVersion. TODO - Not supported yet.

  • dnsLookUpType: default a. DNS record type we are looking for during discovery of cluster nodes. Default behaviour is looking for A records. Supported values are:

    • a
    • srv

Implementations

impl ClientSettings[src]

pub fn parse(input: &str) -> IResult<&str, Self>[src]

pub fn parse_str(input: &str) -> Result<Self, ClientSettingsParseError>[src]

pub fn to_uri(&self, endpoint: &Endpoint) -> Uri[src]

Trait Implementations

impl Clone for ClientSettings[src]

impl Debug for ClientSettings[src]

impl Default for ClientSettings[src]

impl<'de> Deserialize<'de> for ClientSettings[src]

impl Eq for ClientSettings[src]

impl FromStr for ClientSettings[src]

type Err = ClientSettingsParseError

The associated error which can be returned from parsing.

impl PartialEq<ClientSettings> for ClientSettings[src]

impl Serialize for ClientSettings[src]

impl StructuralEq for ClientSettings[src]

impl StructuralPartialEq for ClientSettings[src]

Auto Trait Implementations

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<Q, K> Equivalent<K> for Q where
    K: Borrow<Q> + ?Sized,
    Q: Eq + ?Sized
[src]

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

impl<T> Instrument for T[src]

impl<T> Instrument for T[src]

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

impl<T> IntoRequest<T> for 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>, 

impl<T> WithSubscriber for T[src]