[−][src]Struct pulsar::producer::Producer
Implementations
impl<Exe: Executor> Producer<Exe>
[src]
pub fn builder(pulsar: &Pulsar<Exe>) -> ProducerBuilder<Exe>
[src]
pub fn topic(&self) -> &str
[src]
pub fn partitions(&self) -> Option<Vec<String>>
[src]
pub fn options(&self) -> &ProducerOptions
[src]
pub fn create_message(&mut self) -> MessageBuilder<(), Exe>
[src]
pub async fn check_connection<'_>(&'_ self) -> Result<(), Error>
[src]
pub async fn send<T: SerializeMessage + Sized, '_>(
&'_ mut self,
message: T
) -> Result<SendFuture, Error>
[src]
&'_ mut self,
message: T
) -> Result<SendFuture, Error>
Sends a message
this function returns a SendFuture
because the receipt can come long after
this function was called, for various reasons:
- the message was sent successfully but Pulsar did not send the receipt yet
- the producer is batching messages, so this function must return immediately, and the receipt will come when the batched messages are actually sent
Usage:
let f1 = producer.send("hello").await?; let f2 = producer.send("world").await?; let receipt1 = f1.await?; let receipt2 = f2.await?;
pub async fn send_all<T, I, '_>(
&'_ mut self,
messages: I
) -> Result<Vec<SendFuture>, Error> where
T: SerializeMessage,
I: IntoIterator<Item = T>,
[src]
&'_ mut self,
messages: I
) -> Result<Vec<SendFuture>, Error> where
T: SerializeMessage,
I: IntoIterator<Item = T>,
pub async fn send_batch<'_>(&'_ mut self) -> Result<(), Error>
[src]
sends the current batch of messages
Auto Trait Implementations
impl<Exe> !RefUnwindSafe for Producer<Exe>
impl<Exe> Send for Producer<Exe>
impl<Exe> Sync for Producer<Exe>
impl<Exe> Unpin for Producer<Exe>
impl<Exe> !UnwindSafe for Producer<Exe>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,