pub struct NewTopic {
pub name: String,
pub num_partitions: i32,
pub replication_factor: i16,
pub configs: BTreeMap<String, String>,
}Expand description
Topic definition used with KafkaAdmin::create_topics.
num_partitions and replication_factor must both be positive. Additional
topic-level broker configs can be attached with NewTopic::with_config.
use kafkit_client::NewTopic;
admin
.create_topics([
NewTopic::new("orders", 6, 3)
.with_config("cleanup.policy", "delete")
.with_config("retention.ms", "604800000"),
])
.await?;Fields§
§name: StringTopic name to create.
num_partitions: i32Number of partitions for the new topic.
replication_factor: i16Number of replicas Kafka should create for each partition.
configs: BTreeMap<String, String>Topic-level configuration entries.
Implementations§
Trait Implementations§
Auto Trait Implementations§
impl Freeze for NewTopic
impl RefUnwindSafe for NewTopic
impl Send for NewTopic
impl Sync for NewTopic
impl Unpin for NewTopic
impl UnsafeUnpin for NewTopic
impl UnwindSafe for NewTopic
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