pub struct ClientSettings { /* private fields */ }
Expand description

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.

  • 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
  • keepAliveInterval: default 10s

  • keepAliveTimeout: default 10s

Implementations

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Returns the “default value” for a type. Read more

Deserialize this value from the given Serde deserializer. Read more

The associated error which can be returned from parsing.

Parses a string s to return a value of this type. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Compare self to key and return true if they are equal.

Returns the argument unchanged.

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

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

Calls U::from(self).

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

Wrap the input message T in a tonic::Request

The resulting type after obtaining ownership.

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

🔬 This is a nightly-only experimental API. (toowned_clone_into)

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

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

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

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