pub struct LapinTestPublisher { /* private fields */ }Expand description
The live publisher into the in-process router.
Mirrors ConfirmsPublisher transaction semantics: publishes
buffer between begin_transaction and commit, abort discards them, and a call with no
open transaction errors. Clones share the transaction buffer. Like the real publishers it
aliases the transport and may outlive it: after the broker shuts down every publish reports
AmqpError::Closed.
Trait Implementations§
Source§impl Clone for LapinTestPublisher
impl Clone for LapinTestPublisher
Source§fn clone(&self) -> LapinTestPublisher
fn clone(&self) -> LapinTestPublisher
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for LapinTestPublisher
impl Debug for LapinTestPublisher
Source§impl OwnedTransactions for LapinTestPublisher
Owned transactions, mirroring ConfirmsPublisher: every call
opens an independent buffer-owning LapinTestTransaction, so any number can be open at
once and the publisher keeps routing directly meanwhile.
impl OwnedTransactions for LapinTestPublisher
Owned transactions, mirroring ConfirmsPublisher: every call
opens an independent buffer-owning LapinTestTransaction, so any number can be open at
once and the publisher keeps routing directly meanwhile.
Source§async fn transaction(&self) -> Result<Self::Transaction, Self::Error>
async fn transaction(&self) -> Result<Self::Transaction, Self::Error>
Opens a transaction owned by the returned value.
§Errors
Never fails: opening allocates a buffer and never touches the router.
Source§type Transaction = LapinTestTransaction
type Transaction = LapinTestTransaction
transaction.Source§impl Publisher for LapinTestPublisher
impl Publisher for LapinTestPublisher
Source§async fn publish(&self, msg: OutgoingMessage<'_>) -> Result<(), Self::Error>
async fn publish(&self, msg: OutgoingMessage<'_>) -> Result<(), Self::Error>
Routes msg to subscribers of the queue named by msg.name().
§Errors
Returns AmqpError::InvalidOptions when the routing key is empty and
AmqpError::Closed once the transport has shut down.
Source§impl TransactionalPublisher for LapinTestPublisher
impl TransactionalPublisher for LapinTestPublisher
Source§async fn begin_transaction(&self) -> Result<(), Self::Error>
async fn begin_transaction(&self) -> Result<(), Self::Error>
Opens the buffering transaction.
§Errors
Returns AmqpError::Transaction when a transaction is already open; the open
transaction is left untouched.
Source§async fn commit(&self) -> Result<(), Self::Error>
async fn commit(&self) -> Result<(), Self::Error>
Replays the buffered publishes in order.
§Errors
Returns AmqpError::Transaction when no transaction is open and AmqpError::Closed
once the transport has shut down.