pub struct AsyncProducer { /* private fields */ }Expand description
An async Kafka producer.
This producer always uses native async I/O via tokio sockets.
Implementations§
Source§impl AsyncProducer
impl AsyncProducer
Sourcepub fn builder(hosts: Vec<String>) -> AsyncProducerBuilder
pub fn builder(hosts: Vec<String>) -> AsyncProducerBuilder
Starts building a new async producer from bootstrap hosts.
Sourcepub async fn new(client: AsyncKafkaClient) -> Result<Self>
pub async fn new(client: AsyncKafkaClient) -> Result<Self>
Creates a new async producer from an AsyncKafkaClient.
Sourcepub async fn new_with_config(
client: AsyncKafkaClient,
config: AsyncProducerConfig,
) -> Result<Self>
pub async fn new_with_config( client: AsyncKafkaClient, config: AsyncProducerConfig, ) -> Result<Self>
Creates a new async producer with explicit configuration.
Sourcepub async fn from_hosts(hosts: Vec<String>) -> Result<Self>
pub async fn from_hosts(hosts: Vec<String>) -> Result<Self>
Creates a new async producer directly from bootstrap hosts.
Sourcepub async fn from_hosts_with_config(
hosts: Vec<String>,
config: AsyncProducerConfig,
) -> Result<Self>
pub async fn from_hosts_with_config( hosts: Vec<String>, config: AsyncProducerConfig, ) -> Result<Self>
Creates a new async producer from hosts with explicit configuration.
Auto Trait Implementations§
impl Freeze for AsyncProducer
impl !RefUnwindSafe for AsyncProducer
impl Send for AsyncProducer
impl Sync for AsyncProducer
impl Unpin for AsyncProducer
impl UnsafeUnpin for AsyncProducer
impl !UnwindSafe for AsyncProducer
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