Trait ServiceBusClientProducerExt

Source
pub trait ServiceBusClientProducerExt {
    // Required method
    fn create_producer_for_queue(
        &mut self,
        queue_name: impl Into<String> + Send,
        options: ServiceBusSenderOptions,
    ) -> impl Future<Output = Result<Producer, Error>>;
}
Expand description

Extension trait for ServiceBusClient to create Producer instances.

This trait provides a convenient method to create a Producer directly from a ServiceBusClient without manually creating the sender first.

Required Methods§

Source

fn create_producer_for_queue( &mut self, queue_name: impl Into<String> + Send, options: ServiceBusSenderOptions, ) -> impl Future<Output = Result<Producer, Error>>

Creates a Producer for the specified queue.

§Arguments
  • queue_name - Name of the queue to create a producer for
  • options - Configuration options for the sender
§Returns

A Producer instance configured for the specified queue

§Errors

Returns an error if the sender creation fails

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl<RP> ServiceBusClientProducerExt for ServiceBusClient<RP>

Source§

async fn create_producer_for_queue( &mut self, queue_name: impl Into<String> + Send, options: ServiceBusSenderOptions, ) -> Result<Producer, Error>

Creates a Producer for the specified queue using this ServiceBusClient.

This method handles the creation of the underlying sender and wraps it in a Producer instance for easier usage.

Implementors§