[−][src]Struct eventstore::ClientSettings
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
: default3
. Maximum number of DNS discovery attempts before the connection gives up. TODO - Current behavior keeps retrying ensdlessly. -
discoveryInterval
: default500ms
. Waiting period between discovery attempts. -
gossipTimeout
: default3s
: Waiting period before a gossip request timeout. TODO - Current behavior doesn't timeout at all. -
tls
: defaulttrue
. Use a secure connection. -
tlsVerifyCert
: defaulttrue
. When using a secure connection, perform a certification verification. -
nodePreference
: defaultrandom
. 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
: defaulttrue
. If the client raise an exception when facing aWrongExpectedVersion
. TODO - Not supported yet.
Implementations
impl ClientSettings
[src]
pub fn is_dns_discovery_enabled(&self) -> bool
[src]
pub fn hosts(&self) -> &Vec<Endpoint>
[src]
pub fn max_discover_attempts(&self) -> usize
[src]
pub fn discovery_interval(&self) -> Duration
[src]
pub fn gossip_timeout(&self) -> Duration
[src]
pub fn node_preference(&self) -> NodePreference
[src]
pub fn is_secure_mode_enabled(&self) -> bool
[src]
pub fn is_tls_certificate_verification_enabled(&self) -> bool
[src]
pub fn is_throw_on_append_failure_enabled(&self) -> bool
[src]
pub fn default_authenticated_user(&self) -> &Option<Credentials>
[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]
pub fn clone(&self) -> ClientSettings
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Debug for ClientSettings
[src]
impl Default for ClientSettings
[src]
impl<'de> Deserialize<'de> for ClientSettings
[src]
pub fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
__D: Deserializer<'de>,
impl Eq for ClientSettings
[src]
impl FromStr for ClientSettings
[src]
type Err = ClientSettingsParseError
The associated error which can be returned from parsing.
pub fn from_str(s: &str) -> Result<Self, Self::Err>
[src]
impl PartialEq<ClientSettings> for ClientSettings
[src]
pub fn eq(&self, other: &ClientSettings) -> bool
[src]
pub fn ne(&self, other: &ClientSettings) -> bool
[src]
impl Serialize for ClientSettings
[src]
pub fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error> where
__S: Serializer,
[src]
__S: Serializer,
impl StructuralEq for ClientSettings
[src]
impl StructuralPartialEq for ClientSettings
[src]
Auto Trait Implementations
impl RefUnwindSafe for ClientSettings
impl Send for ClientSettings
impl Sync for ClientSettings
impl Unpin for ClientSettings
impl UnwindSafe for ClientSettings
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> DeserializeOwned for T where
T: for<'de> Deserialize<'de>,
[src]
T: for<'de> Deserialize<'de>,
impl<Q, K> Equivalent<K> for Q where
K: Borrow<Q> + ?Sized,
Q: Eq + ?Sized,
[src]
K: Borrow<Q> + ?Sized,
Q: Eq + ?Sized,
pub fn equivalent(&self, key: &K) -> bool
[src]
impl<T> From<T> for T
[src]
impl<T> Instrument for T
[src]
pub fn instrument(self, span: Span) -> Instrumented<Self>
[src]
pub fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T> Instrument for T
[src]
pub fn instrument(self, span: Span) -> Instrumented<Self>
[src]
pub fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> IntoRequest<T> for T
[src]
pub fn into_request(self) -> Request<T>
[src]
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,
pub fn vzip(self) -> V
impl<T> WithSubscriber for T
[src]
pub fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
[src]
S: Into<Dispatch>,