Struct fluvio::TopicProducer [−][src]
pub struct TopicProducer { /* fields omitted */ }
Expand description
An interface for producing events to a particular topic
A TopicProducer
allows you to send events to the specific
topic it was initialized for. Once you have a TopicProducer
,
you can send events to the topic, choosing which partition
each event should be delivered to.
Implementations
impl TopicProducer
[src]
impl TopicProducer
[src]pub async fn send<K, V>(&self, key: K, value: V) -> Result<(), FluvioError> where
K: Into<RecordKey>,
V: Into<RecordData>,
[src]
pub async fn send<K, V>(&self, key: K, value: V) -> Result<(), FluvioError> where
K: Into<RecordKey>,
V: Into<RecordData>,
[src]Sends a key/value record to this producer’s Topic.
The partition that the record will be sent to is derived from the Key.
Example
producer.send("Key", "Value").await?;
pub async fn send_all<K, V, I>(&self, records: I) -> Result<(), FluvioError> where
K: Into<RecordKey>,
V: Into<RecordData>,
I: IntoIterator<Item = (K, V)>,
[src]
K: Into<RecordKey>,
V: Into<RecordData>,
I: IntoIterator<Item = (K, V)>,
pub async fn send_record<B: AsRef<[u8]>>(
&self,
buffer: B,
_partition: i32
) -> Result<(), FluvioError>
[src]
👎 Deprecated since 0.6.2: Use ‘send’ instead
pub async fn send_record<B: AsRef<[u8]>>(
&self,
buffer: B,
_partition: i32
) -> Result<(), FluvioError>
[src]👎 Deprecated since 0.6.2:
Use ‘send’ instead
Sends an event to a specific partition within this producer’s topic
Example
let partition = 0; producer.send_record("Hello, Fluvio!", partition).await?;
Auto Trait Implementations
impl !RefUnwindSafe for TopicProducer
impl Send for TopicProducer
impl Sync for TopicProducer
impl Unpin for TopicProducer
impl !UnwindSafe for TopicProducer
Blanket Implementations
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]pub fn borrow_mut(&mut self) -> &mut T
[src]
pub fn borrow_mut(&mut self) -> &mut T
[src]Mutably borrows from an owned value. Read more
impl<T> Instrument for T
[src]
impl<T> Instrument for T
[src]fn instrument(self, span: Span) -> Instrumented<Self>
[src]
fn instrument(self, span: Span) -> Instrumented<Self>
[src]Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more
fn in_current_span(self) -> Instrumented<Self>
[src]
fn in_current_span(self) -> Instrumented<Self>
[src]impl<T> AsyncConnector for T where
T: Send + Sync,
[src]
T: Send + Sync,