[−][src]Struct pulsar::producer::MultiTopicProducer
Wrapper structure that manges multiple producers at once, creating them as needed
use pulsar::{Pulsar, TokioExecutor}; let pulsar: Pulsar<_> = Pulsar::builder(addr, TokioExecutor).build().await?; let mut producer = pulsar.producer() .with_name("name") .build_multi_topic(); let send_1 = producer.send(topic, &message).await?; let send_2 = producer.send(topic, &message).await?; send_1.await?; send_2.await?;
Implementations
impl<Exe: Executor> MultiTopicProducer<Exe>
[src]
pub fn options(&self) -> &ProducerOptions
[src]
pub fn topics(&self) -> Vec<String>
[src]
pub async fn close_producer<S: Into<String>, '_>(
&'_ mut self,
topic: S
) -> Result<(), Error>
[src]
&'_ mut self,
topic: S
) -> Result<(), Error>
pub async fn send<T: SerializeMessage + Sized, S: Into<String>, '_>(
&'_ mut self,
topic: S,
message: T
) -> Result<SendFuture, Error>
[src]
&'_ mut self,
topic: S,
message: T
) -> Result<SendFuture, Error>
pub async fn send_all<'a, 'b, T, S, I, '_>(
&'_ mut self,
topic: S,
messages: I
) -> Result<Vec<SendFuture>, Error> where
'b: 'a,
T: 'b + SerializeMessage + Sized,
I: IntoIterator<Item = T>,
S: Into<String>,
[src]
&'_ mut self,
topic: S,
messages: I
) -> Result<Vec<SendFuture>, Error> where
'b: 'a,
T: 'b + SerializeMessage + Sized,
I: IntoIterator<Item = T>,
S: Into<String>,
Auto Trait Implementations
impl<Exe> !RefUnwindSafe for MultiTopicProducer<Exe>
impl<Exe> Send for MultiTopicProducer<Exe>
impl<Exe> Sync for MultiTopicProducer<Exe>
impl<Exe> Unpin for MultiTopicProducer<Exe>
impl<Exe> !UnwindSafe for MultiTopicProducer<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>,