pub struct Publisher { /* private fields */ }Expand description
Simplified Publisher for message publishing
Implementations§
Source§impl Publisher
impl Publisher
Sourcepub fn new(connection: Arc<Connection>) -> Self
pub fn new(connection: Arc<Connection>) -> Self
Create a new publisher
Sourcepub async fn publish_to_exchange<T>(
&self,
exchange: &str,
routing_key: &str,
message: &T,
options: Option<PublishOptions>,
) -> Result<(), RustRabbitError>where
T: Serialize,
pub async fn publish_to_exchange<T>(
&self,
exchange: &str,
routing_key: &str,
message: &T,
options: Option<PublishOptions>,
) -> Result<(), RustRabbitError>where
T: Serialize,
Publish message to an exchange
Sourcepub async fn publish_to_queue<T>(
&self,
queue: &str,
message: &T,
options: Option<PublishOptions>,
) -> Result<(), RustRabbitError>where
T: Serialize,
pub async fn publish_to_queue<T>(
&self,
queue: &str,
message: &T,
options: Option<PublishOptions>,
) -> Result<(), RustRabbitError>where
T: Serialize,
Publish message directly to a queue
Sourcepub async fn publish_envelope_to_exchange<T>(
&self,
exchange: &str,
routing_key: &str,
envelope: &MessageEnvelope<T>,
options: Option<PublishOptions>,
) -> Result<(), RustRabbitError>where
T: Serialize,
pub async fn publish_envelope_to_exchange<T>(
&self,
exchange: &str,
routing_key: &str,
envelope: &MessageEnvelope<T>,
options: Option<PublishOptions>,
) -> Result<(), RustRabbitError>where
T: Serialize,
Publish a message envelope to an exchange (includes retry metadata)
Sourcepub async fn publish_envelope_to_queue<T>(
&self,
queue: &str,
envelope: &MessageEnvelope<T>,
options: Option<PublishOptions>,
) -> Result<(), RustRabbitError>where
T: Serialize,
pub async fn publish_envelope_to_queue<T>(
&self,
queue: &str,
envelope: &MessageEnvelope<T>,
options: Option<PublishOptions>,
) -> Result<(), RustRabbitError>where
T: Serialize,
Publish a message envelope directly to a queue (includes retry metadata)
Sourcepub async fn publish_with_envelope<T>(
&self,
exchange: &str,
routing_key: &str,
payload: &T,
source_queue: &str,
max_retries: u32,
options: Option<PublishOptions>,
) -> Result<(), RustRabbitError>
pub async fn publish_with_envelope<T>( &self, exchange: &str, routing_key: &str, payload: &T, source_queue: &str, max_retries: u32, options: Option<PublishOptions>, ) -> Result<(), RustRabbitError>
Create a message envelope with source tracking and publish to exchange
Sourcepub async fn publish_with_envelope_to_queue<T>(
&self,
queue: &str,
payload: &T,
max_retries: u32,
options: Option<PublishOptions>,
) -> Result<(), RustRabbitError>
pub async fn publish_with_envelope_to_queue<T>( &self, queue: &str, payload: &T, max_retries: u32, options: Option<PublishOptions>, ) -> Result<(), RustRabbitError>
Create a message envelope and publish directly to queue
Auto Trait Implementations§
impl Freeze for Publisher
impl !RefUnwindSafe for Publisher
impl Send for Publisher
impl Sync for Publisher
impl Unpin for Publisher
impl !UnwindSafe for Publisher
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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