pub struct ClientConfig {
pub log_level: RDKafkaLogLevel,
/* private fields */
}Expand description
Client configuration.
Fields§
§log_level: RDKafkaLogLevelThe librdkafka logging level. Refer to RDKafkaLogLevel for the list
of available levels.
Implementations§
Source§impl ClientConfig
impl ClientConfig
Sourcepub fn new() -> ClientConfig
Available on non-madsim only.
pub fn new() -> ClientConfig
madsim only.Creates a new empty configuration.
Sourcepub fn config_map(&self) -> &HashMap<String, String>
Available on non-madsim only.
pub fn config_map(&self) -> &HashMap<String, String>
madsim only.Gets a reference to the underlying config map
Sourcepub fn get(&self, key: &str) -> Option<&str>
Available on non-madsim only.
pub fn get(&self, key: &str) -> Option<&str>
madsim only.Gets the value of a parameter in the configuration.
Returns the current value set for key, or None if no value for key
exists.
Note that this method will only ever return values that were installed
by a call to ClientConfig::set. To retrieve librdkafka’s default
value for a parameter, build a NativeClientConfig and then call
NativeClientConfig::get on the resulting object.
Sourcepub fn set<K, V>(&mut self, key: K, value: V) -> &mut ClientConfig
Available on non-madsim only.
pub fn set<K, V>(&mut self, key: K, value: V) -> &mut ClientConfig
madsim only.Sets a parameter in the configuration.
If there is an existing value for key in the configuration, it is
overridden with the new value.
Sourcepub fn remove<'a>(&'a mut self, key: &str) -> &'a mut ClientConfig
Available on non-madsim only.
pub fn remove<'a>(&'a mut self, key: &str) -> &'a mut ClientConfig
madsim only.Removes a parameter from the configuration.
Sourcepub fn set_log_level(&mut self, log_level: RDKafkaLogLevel) -> &mut ClientConfig
Available on non-madsim only.
pub fn set_log_level(&mut self, log_level: RDKafkaLogLevel) -> &mut ClientConfig
madsim only.Sets the log level of the client. If not specified, the log level will be calculated based on the global log level of the log crate.
Sourcepub fn create_native_config(&self) -> KafkaResult<NativeClientConfig>
Available on non-madsim only.
pub fn create_native_config(&self) -> KafkaResult<NativeClientConfig>
madsim only.Builds a native librdkafka configuration.
Sourcepub async fn create<T: FromClientConfig>(&self) -> KafkaResult<T>
Available on non-madsim only.
pub async fn create<T: FromClientConfig>(&self) -> KafkaResult<T>
madsim only.Uses the current configuration to create a new Consumer or Producer.
Sourcepub async fn create_with_context<C, T>(&self, context: C) -> KafkaResult<T>where
C: ClientContext,
T: FromClientConfigAndContext<C>,
Available on non-madsim only.
pub async fn create_with_context<C, T>(&self, context: C) -> KafkaResult<T>where
C: ClientContext,
T: FromClientConfigAndContext<C>,
madsim only.Uses the current configuration and the provided context to create a new Consumer or Producer.
Trait Implementations§
Source§impl Clone for ClientConfig
Available on non-madsim only.
impl Clone for ClientConfig
madsim only.Source§fn clone(&self) -> ClientConfig
fn clone(&self) -> ClientConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ClientConfig
Available on non-madsim only.
impl Debug for ClientConfig
madsim only.Source§impl Default for ClientConfig
Available on non-madsim only.
impl Default for ClientConfig
madsim only.Source§impl Extend<(String, String)> for ClientConfig
Available on non-madsim only.
impl Extend<(String, String)> for ClientConfig
madsim only.Source§fn extend<I>(&mut self, iter: I)
fn extend<I>(&mut self, iter: I)
Source§fn extend_one(&mut self, item: A)
fn extend_one(&mut self, item: A)
extend_one)Source§fn extend_reserve(&mut self, additional: usize)
fn extend_reserve(&mut self, additional: usize)
extend_one)Source§impl FromIterator<(String, String)> for ClientConfig
Available on non-madsim only.
impl FromIterator<(String, String)> for ClientConfig
madsim only.