Skip to content

Commit fef0c62

Browse files
committed
Add setters for the rest of the fields of BaseRecord.
1 parent fa98b5d commit fef0c62

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/producer/base_producer.rs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,18 @@ impl<'a, K: ToBytes + ?Sized, P: ToBytes + ?Sized, D: IntoOpaque> BaseRecord<'a,
196196
self.headers = Some(headers);
197197
self
198198
}
199+
200+
/// Sets the destination topic of the record.
201+
pub fn topic(mut self, topic: &'a str) -> BaseRecord<'a, K, P, D> {
202+
self.topic = topic;
203+
self
204+
}
205+
206+
/// Sets the delivery opaque of the record.
207+
pub fn delivery_opaque(mut self, delivery_opaque: D) -> BaseRecord<'a, K, P, D> {
208+
self.delivery_opaque = delivery_opaque;
209+
self
210+
}
199211
}
200212

201213
impl<'a, K: ToBytes + ?Sized, P: ToBytes + ?Sized> BaseRecord<'a, K, P, ()> {

0 commit comments

Comments
 (0)