pub struct Producer { /* private fields */ }Expand description
A producer that sends messages to a named topic.
Implementations§
Source§impl Producer
impl Producer
Sourcepub fn with_partitioner(self, p: Partitioner) -> Self
pub fn with_partitioner(self, p: Partitioner) -> Self
Set the partitioning strategy.
Sourcepub fn send(&mut self, mgr: &mut TopicManager, value: &[u8]) -> Result<u64>
pub fn send(&mut self, mgr: &mut TopicManager, value: &[u8]) -> Result<u64>
Send a message without a key (uses round-robin partitioning).
Sourcepub fn send_keyed(
&mut self,
mgr: &mut TopicManager,
key: &[u8],
value: &[u8],
) -> Result<u64>
pub fn send_keyed( &mut self, mgr: &mut TopicManager, key: &[u8], value: &[u8], ) -> Result<u64>
Send a keyed message.
With Partitioner::KeyHash, the key determines the partition.
With Partitioner::RoundRobin, the key is stored but partition
selection still uses round-robin.
Auto Trait Implementations§
impl Freeze for Producer
impl RefUnwindSafe for Producer
impl Send for Producer
impl Sync for Producer
impl Unpin for Producer
impl UnwindSafe for Producer
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