pub struct Kafka { /* private fields */ }
Implementations§
Source§impl Kafka
impl Kafka
Sourcepub fn connect(config: JsonValue) -> Self
pub fn connect(config: JsonValue) -> Self
链接
- config 配置
{
"default": "mac",
"connections": {
"mac": {
"brokers": [
"0.0.0.0:9092"
],
"fetch_max": 900000000,
"retry_max": 900000000
}
}
}
Sourcepub fn add_config(&mut self, connection: JsonValue) -> &mut Self
pub fn add_config(&mut self, connection: JsonValue) -> &mut Self
增加配置
Sourcepub fn switch_config(&mut self, default: &str) -> &mut Self
pub fn switch_config(&mut self, default: &str) -> &mut Self
切换配置
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Kafka
impl RefUnwindSafe for Kafka
impl Send for Kafka
impl Sync for Kafka
impl Unpin for Kafka
impl UnwindSafe for Kafka
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