pub struct LapinPublish(/* private fields */);Expand description
The fire-and-forget publish policy: pure declaration, constructible anywhere.
OutgoingMessage::name is the routing key; the target
exchange is a property of the policy (the default exchange unless
exchange says otherwise). On the default exchange the routing key
addresses the queue with that name. Messages are published persistent (delivery mode 2)
unless persistent(false) opts out.
It pairs into LapinPublisher, and it is the broker’s
DefaultPublish policy, so a publish("dest") handler mounted
without an explicit publisher replies through it. confirms and
server_tx move to the transactional policies, keeping the options.
§Examples
use ruststream_lapin::LapinPublish;
let events = LapinPublish::default().exchange("events");
let shipments = LapinPublish::default().confirms();Implementations§
Source§impl LapinPublish
impl LapinPublish
Sourcepub fn exchange(self, exchange: impl Into<String>) -> Self
pub fn exchange(self, exchange: impl Into<String>) -> Self
Publishes to exchange instead of the default exchange.
Sourcepub fn persistent(self, persistent: bool) -> Self
pub fn persistent(self, persistent: bool) -> Self
Whether messages are marked persistent (delivery mode 2). Defaults to true.
Sourcepub fn confirms(self) -> ConfirmsPublish
pub fn confirms(self) -> ConfirmsPublish
Moves to the policy that awaits broker confirms, with buffering transactions.
The recommended transactional publisher: durable and much faster than AMQP server transactions.
Sourcepub fn server_tx(self) -> ServerTxPublish
pub fn server_tx(self) -> ServerTxPublish
Moves to the policy backed by AMQP server transactions (tx.select).
Server-side atomicity, at the cost of a synchronous commit round trip that is
significantly slower than confirms.
Trait Implementations§
Source§impl Clone for LapinPublish
impl Clone for LapinPublish
Source§fn clone(&self) -> LapinPublish
fn clone(&self) -> LapinPublish
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 LapinPublish
impl Debug for LapinPublish
Source§impl Default for LapinPublish
impl Default for LapinPublish
Source§fn default() -> LapinPublish
fn default() -> LapinPublish
impl Eq for LapinPublish
Source§impl LapinPublishPolicy for LapinPublish
impl LapinPublishPolicy for LapinPublish
Source§fn bind(self, connected: &ConnectedLapinBroker) -> Self::Live
fn bind(self, connected: &ConnectedLapinBroker) -> Self::Live
Source§impl PartialEq for LapinPublish
impl PartialEq for LapinPublish
Source§impl PublishPolicy<ConnectedLapinBroker> for LapinPublish
impl PublishPolicy<ConnectedLapinBroker> for LapinPublish
Source§type Live = LapinPublisher
type Live = LapinPublisher
Publisher for a leaf policy, or the live
wiring form for a combinator stack (a typed publisher over a policy pairs into the same
typed publisher over the live leaf).