[][src]Struct nakadion::api::Builder

#[non_exhaustive]pub struct Builder {
    pub nakadi_base_url: Option<NakadiBaseUrl>,
    pub timeout_millis: Option<ApiClientTimeoutMillis>,
    pub attempt_timeout_millis: Option<ApiClientAttemptTimeoutMillis>,
    pub initial_retry_interval_millis: Option<ApiClientInitialRetryIntervalMillis>,
    pub retry_interval_multiplier: Option<ApiClientRetryIntervalMultiplier>,
    pub max_retry_interval_millis: Option<ApiClientMaxRetryIntervalMillis>,
    pub retry_on_auth_errors: Option<ApiClientRetryOnAuthErrors>,
}

Fields (Non-exhaustive)

Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.
nakadi_base_url: Option<NakadiBaseUrl>timeout_millis: Option<ApiClientTimeoutMillis>

Timeout for a complete publishing including potential retries

attempt_timeout_millis: Option<ApiClientAttemptTimeoutMillis>

Timeout for a single request attempt to Nakadi

initial_retry_interval_millis: Option<ApiClientInitialRetryIntervalMillis>

Interval length before the first retry attempt

retry_interval_multiplier: Option<ApiClientRetryIntervalMultiplier>

Multiplier for the length of of the next retry interval

max_retry_interval_millis: Option<ApiClientMaxRetryIntervalMillis>

Maximum length of an interval before a retry

retry_on_auth_errors: Option<ApiClientRetryOnAuthErrors>

Retry on authentication/authorization errors if true

Implementations

impl Builder[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]

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 nakadi_base_url(self, url: NakadiBaseUrl) -> Self[src]

pub fn timeout_millis<T: Into<ApiClientTimeoutMillis>>(self, v: T) -> Self[src]

Timeout for a complete request including potential retries

pub fn attempt_timeout_millis<T: Into<ApiClientAttemptTimeoutMillis>>(
    self,
    v: T
) -> Self
[src]

Timeout for a single attempt to get a response from Nakadi

pub fn initial_retry_interval_millis<T: Into<ApiClientInitialRetryIntervalMillis>>(
    self,
    v: T
) -> Self
[src]

Interval length before the first retry attempt

pub fn retry_interval_multiplier<T: Into<ApiClientRetryIntervalMultiplier>>(
    self,
    v: T
) -> Self
[src]

Multiplier for the length of of the next retry interval

pub fn max_retry_interval_millis<T: Into<ApiClientMaxRetryIntervalMillis>>(
    self,
    v: T
) -> Self
[src]

Maximum length of an interval before a retry

pub fn retry_on_auth_errors<T: Into<ApiClientRetryOnAuthErrors>>(
    self,
    v: T
) -> Self
[src]

Retry on authentication/authorization errors if true

impl Builder[src]

pub fn build_with<D, P>(
    self,
    dispatch_http_request: D,
    access_token_provider: P
) -> Result<ApiClient, Error> where
    D: DispatchHttpRequest + Send + Sync + 'static,
    P: ProvidesAccessToken + Send + Sync + 'static, 
[src]

Build an ApiClient from this Builder

No environment variables are read

pub fn build_from_env_with_dispatcher<D>(
    self,
    dispatch_http_request: D
) -> Result<ApiClient, Error> where
    D: DispatchHttpRequest + Send + Sync + 'static, 
[src]

Build an ApiClient from this Builder

Unset fields of this Builder will be set from the environment including the settings for the ProvidesAccessToken

Environment variables must be prefixed with NAKADION

pub fn build_from_env_prefixed_with_dispatcher<T, D>(
    self,
    prefix: T,
    dispatch_http_request: D
) -> Result<ApiClient, Error> where
    T: AsRef<str>,
    D: DispatchHttpRequest + Send + Sync + 'static, 
[src]

Build an ApiClient from this Builder

Unset fields of this Builder will be set from the environment including the settings for the ProvidesAccessToken

impl Builder[src]

pub fn finish<P>(self, access_token_provider: P) -> Result<ApiClient, Error> where
    P: ProvidesAccessToken + Send + Sync + 'static, 
[src]

pub fn finish_from_env(self) -> Result<ApiClient, Error>[src]

pub fn finish_from_env_prefixed<T>(self, prefix: T) -> Result<ApiClient, Error> where
    T: AsRef<str>, 
[src]

Trait Implementations

impl Debug for Builder[src]

impl Default for Builder[src]

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

impl Serialize for Builder[src]

Auto Trait Implementations

impl RefUnwindSafe for Builder

impl Send for Builder

impl Sync for Builder

impl Unpin for Builder

impl UnwindSafe for Builder

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<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> SendSyncUnwindSafe for T where
    T: Send + Sync + UnwindSafe + ?Sized
[src]

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>,