Struct nakadion::api::ConfigBuilder [−][src]
pub struct ConfigBuilder { pub nakadi_host: Option<String>, pub request_timeout: Option<Duration>, }
Fields
nakadi_host: Option<String>
The Nakadi host
request_timeout: Option<Duration>
The request timeout when connecting to Nakadi
Methods
impl ConfigBuilder
[src]
impl ConfigBuilder
pub fn nakadi_host<T: Into<String>>(self, nakadi_host: T) -> ConfigBuilder
[src]
pub fn nakadi_host<T: Into<String>>(self, nakadi_host: T) -> ConfigBuilder
The URI prefix for the Nakadi Host, e.g. "https://my.nakadi.com"
pub fn request_timeout(self, request_timeout: Duration) -> ConfigBuilder
[src]
pub fn request_timeout(self, request_timeout: Duration) -> ConfigBuilder
Timeout after which a conection to the REST API
is aborted. If None
wait indefinitely
pub fn from_env() -> Result<ConfigBuilder, Error>
[src]
pub fn from_env() -> Result<ConfigBuilder, Error>
Create a builder from environment variables.
Environment Variables:
For variables not found except 'NAKADION_NAKADI_HOST' a default will be set.
Variables:
- NAKADION_NAKADI_HOST: Host address of Nakadi. The host is mandatory.
- NAKADION_REQUEST_TIMEOUT_MS: Timeout in ms after which a conection to the REST API is aborted. This is optional and defaults to 1 second.
Errors
Fails if a value can not be parsed from an existing environment variable.
pub fn build(self) -> Result<Config, Error>
[src]
pub fn build(self) -> Result<Config, Error>
pub fn build_client<T>(
self,
token_provider: T
) -> Result<NakadiApiClient, Error> where
T: ProvidesAccessToken + Send + Sync + 'static,
[src]
pub fn build_client<T>(
self,
token_provider: T
) -> Result<NakadiApiClient, Error> where
T: ProvidesAccessToken + Send + Sync + 'static,
Directly build an API client from this builder.
Takes ownership of the token_provider
Errors
Fails if this builder is in an invalid state.
Directly build an API client builder.
The token_provider
can be a shared token provider.
Errors
Fails if this builder is in an invalid state.
Trait Implementations
impl Default for ConfigBuilder
[src]
impl Default for ConfigBuilder
fn default() -> ConfigBuilder
[src]
fn default() -> ConfigBuilder
Returns the "default value" for a type. Read more
Auto Trait Implementations
impl Send for ConfigBuilder
impl Send for ConfigBuilder
impl Sync for ConfigBuilder
impl Sync for ConfigBuilder