[−][src]Struct nakadion::components::connector::ConnectConfig
Parameters to configure the Connector
See also Nakadi Manual
Example
use nakadion::components::connector::{ConnectConfig, ConnectTimeout}; let cfg = ConnectConfig::default() .abort_on_auth_error(true) .timeout_secs(25u64); assert_eq!(cfg.abort_on_auth_error, Some(true.into())); assert_eq!(cfg.timeout_secs, Some(ConnectTimeout::Seconds(25)));
Fields (Non-exhaustive)
Struct { .. }
syntax; cannot be matched against without a wildcard ..
; and struct update syntax will not work.stream_parameters: StreamParameters
StreamParameters
used to configure the stream consumed from Nakadi
abort_on_auth_error: Option<ConnectAbortOnAuthError>
If set to true
auth error will not cause a retry on connect attempts
abort_on_conflict: Option<ConnectAbortOnConflict>
If set to true
conflicts (Status 409) will not cause a retry on connect attempts
abort_connect_on_subscription_not_found: Option<ConnectAbortOnSubscriptionNotFound>
If true
abort the consumer when a subscription does not exist when connection to a stream.
It can make sense if the subscription is expected to not already be there on startup and waiting for it to became available is intended.
The default is true
timeout_secs: Option<ConnectTimeout>
The maximum time for until a connection to a stream has to be established.
When elapsed and no stream could be connected to, the Connector
fails
Default is to retry indefinitely
max_retry_delay_secs: Option<ConnectMaxRetryDelaySecs>
The maximum retry delay between failed attempts to connect to a stream.
on_conflict_retry_delay_secs: Option<ConnectOnConflictRetryDelaySecs>
The retry delay between failed attempts when the previous one was a conflict.
attempt_timeout_secs: Option<ConnectAttemptTimeoutSecs>
The timeout for a request made to Nakadi to connect to a stream.
Implementations
impl ConnectConfig
[src]
pub fn from_env() -> Result<Self, Error>
[src]
Initializes all fields from environment variables prefixed with "NAKADION_"
pub fn from_env_prefixed<T: AsRef<str>>(prefix: T) -> Result<Self, Error>
[src]
Initializes all fields from environment variables prefixed with "[prefix]_"
The underscore is omitted if prefix
is empty
pub fn from_env_type_names() -> Result<Self, Error>
[src]
Initializes all fields from environment variables without any prefix
pub fn fill_from_env(&mut self) -> Result<(), Error>
[src]
Updates all not yet set fields from environment variables prefixed with "NAKADION_"
pub fn fill_from_env_prefixed<T: AsRef<str>>(
&mut self,
prefix: T
) -> Result<(), Error>
[src]
&mut self,
prefix: T
) -> Result<(), Error>
Updates all not yet set fields from environment variables prefixed with "[prefix]_"
The underscore is omitted if prefix
is empty
pub fn fill_from_env_type_names(&mut self) -> Result<(), Error>
[src]
Updates all not yet set fields from environment variables without any prefix
pub fn apply_defaults(&mut self)
[src]
Fills not set values with default values.
The filled in values are those which would be used if a value was not set.
pub fn stream_parameters<T: Into<StreamParameters>>(self, v: T) -> Self
[src]
StreamParameters
used to configure the stream consumed from Nakadi
pub fn abort_on_auth_error<T: Into<ConnectAbortOnAuthError>>(self, v: T) -> Self
[src]
If set to true
auth error will not cause a retry on connect attempts
pub fn abort_on_conflict<T: Into<ConnectAbortOnConflict>>(self, v: T) -> Self
[src]
If set to true
conflicts (Status 409) will not cause a retry on connect attempts
pub fn abort_connect_on_subscription_not_found<T: Into<ConnectAbortOnSubscriptionNotFound>>(
self,
v: T
) -> Self
[src]
self,
v: T
) -> Self
If true
abort the consumer when a subscription does not exist when connection to a stream.
pub fn timeout_secs<T: Into<ConnectTimeout>>(self, v: T) -> Self
[src]
The maximum time for until a connection to a stream has to be established.
Default is to retry indefinitely
pub fn max_retry_delay_secs<T: Into<ConnectMaxRetryDelaySecs>>(
self,
v: T
) -> Self
[src]
self,
v: T
) -> Self
The maximum retry delay between failed attempts to connect to a stream.
pub fn attempt_timeout_secs<T: Into<ConnectAttemptTimeoutSecs>>(
self,
v: T
) -> Self
[src]
self,
v: T
) -> Self
The timeout for a request made to Nakadi to connect to a stream.
pub fn on_conflict_retry_delay_secs<T: Into<ConnectOnConflictRetryDelaySecs>>(
self,
v: T
) -> Self
[src]
self,
v: T
) -> Self
The retry delay between failed attempts when the previous one was a conflict.
pub fn configure_stream_parameters<F>(self, f: F) -> Self where
F: FnMut(StreamParameters) -> StreamParameters,
[src]
F: FnMut(StreamParameters) -> StreamParameters,
Modify the current StreamParameters
with a closure.
pub fn try_configure_stream_parameters<F>(self, f: F) -> Result<Self, Error> where
F: FnMut(StreamParameters) -> Result<StreamParameters, Error>,
[src]
F: FnMut(StreamParameters) -> Result<StreamParameters, Error>,
Modify the current StreamParameters
with a closure.
Trait Implementations
impl Clone for ConnectConfig
[src]
pub fn clone(&self) -> ConnectConfig
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Debug for ConnectConfig
[src]
impl Default for ConnectConfig
[src]
pub fn default() -> ConnectConfig
[src]
impl<'de> Deserialize<'de> for ConnectConfig
[src]
pub fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
__D: Deserializer<'de>,
impl Serialize for ConnectConfig
[src]
Auto Trait Implementations
impl RefUnwindSafe for ConnectConfig
impl Send for ConnectConfig
impl Sync for ConnectConfig
impl Unpin for ConnectConfig
impl UnwindSafe for ConnectConfig
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<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> SendSyncUnwindSafe for T where
T: Send + Sync + UnwindSafe + ?Sized,
[src]
T: Send + Sync + UnwindSafe + ?Sized,
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>,