pub struct ConnectOptions {
pub server_url: String,
pub auth: Auth,
pub tls: Tls,
pub connection_timeout: Option<ConfigDuration>,
pub request_timeout: Option<ConfigDuration>,
}Expand description
Options for connecting to a NATS server.
Fields§
§server_url: StringNATS server URL (e.g., “nats://localhost:4222”).
auth: AuthAuthentication configuration.
tls: TlsTLS configuration.
connection_timeout: Option<ConfigDuration>Connection timeout, for example 10s.
How long to wait when establishing the initial connection to the
NATS server. Unset selects the default, DEFAULT_CONNECTION_TIMEOUT.
request_timeout: Option<ConfigDuration>Request timeout, for example 10s.
How long to wait for responses to requests. Unset selects
the default, DEFAULT_REQUEST_TIMEOUT.
Implementations§
Source§impl ConnectOptions
impl ConnectOptions
Sourcepub fn connection_timeout(&self) -> ConfigDuration
pub fn connection_timeout(&self) -> ConfigDuration
The initial-connection timeout in effect, or
DEFAULT_CONNECTION_TIMEOUT.
Sourcepub fn request_timeout(&self) -> ConfigDuration
pub fn request_timeout(&self) -> ConfigDuration
The request timeout in effect, or DEFAULT_REQUEST_TIMEOUT.
Trait Implementations§
Source§impl Clone for ConnectOptions
impl Clone for ConnectOptions
Source§impl Debug for ConnectOptions
impl Debug for ConnectOptions
Source§impl<'de> Deserialize<'de> for ConnectOptions
impl<'de> Deserialize<'de> for ConnectOptions
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for ConnectOptions
Source§impl PartialEq for ConnectOptions
impl PartialEq for ConnectOptions
Source§impl Serialize for ConnectOptions
impl Serialize for ConnectOptions
impl StructuralPartialEq for ConnectOptions
Auto Trait Implementations§
impl Freeze for ConnectOptions
impl RefUnwindSafe for ConnectOptions
impl Send for ConnectOptions
impl Sync for ConnectOptions
impl Unpin for ConnectOptions
impl UnsafeUnpin for ConnectOptions
impl UnwindSafe for ConnectOptions
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more