pub struct AmqpAddress { /* private fields */ }Expand description
A subscription descriptor for an AMQP 1.0 address.
Implements SubscriptionSource, so it can sit inline in the #[subscriber(..)] decorator:
use ruststream_amqp::AmqpAddress;
let source = AmqpAddress::queue("orders").credit(64);Implementations§
Source§impl AmqpAddress
impl AmqpAddress
Sourcepub fn queue(name: impl Into<String>) -> Self
pub fn queue(name: impl Into<String>) -> Self
An anycast address: competing consumers, each message delivered to one of them.
§Examples
use ruststream_amqp::AmqpAddress;
let source = AmqpAddress::queue("orders");Sourcepub fn topic(name: impl Into<String>) -> Self
pub fn topic(name: impl Into<String>) -> Self
A multicast address: fan-out, each message delivered to every subscriber.
§Examples
use ruststream_amqp::AmqpAddress;
let source = AmqpAddress::topic("events");Sourcepub fn raw(address: impl Into<String>) -> Self
pub fn raw(address: impl Into<String>) -> Self
A verbatim address, for deployments with their own addressing convention
("/queues/orders" on RabbitMQ 4.x, a fully qualified queue on Artemis).
§Examples
use ruststream_amqp::AmqpAddress;
let source = AmqpAddress::raw("/queues/orders");Sourcepub fn credit(self, credit: u32) -> Self
pub fn credit(self, credit: u32) -> Self
Sets the protocol-level credit (prefetch): how many unsettled deliveries the broker may
have in flight to this subscription. Defaults to DEFAULT_CREDIT.
Sourcepub fn settle(self, settle: Settle) -> Self
pub fn settle(self, settle: Settle) -> Self
Sets the delivery guarantee. Defaults to Settle::AtLeastOnce.
Trait Implementations§
Source§impl Clone for AmqpAddress
impl Clone for AmqpAddress
Source§fn clone(&self) -> AmqpAddress
fn clone(&self) -> AmqpAddress
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for AmqpAddress
impl Debug for AmqpAddress
impl Eq for AmqpAddress
Source§impl PartialEq for AmqpAddress
impl PartialEq for AmqpAddress
impl StructuralPartialEq for AmqpAddress
Source§impl SubscriptionSource<ConnectedAmqpBroker> for AmqpAddress
impl SubscriptionSource<ConnectedAmqpBroker> for AmqpAddress
Source§type Subscriber = AmqpSubscriber
type Subscriber = AmqpSubscriber
The subscriber type this source opens.
Source§async fn subscribe(
self,
connected: &ConnectedAmqpBroker,
) -> Result<AmqpSubscriber, AmqpError>
async fn subscribe( self, connected: &ConnectedAmqpBroker, ) -> Result<AmqpSubscriber, AmqpError>
Opens the subscription against the connected broker. Called once at startup. Read more
Auto Trait Implementations§
impl Freeze for AmqpAddress
impl RefUnwindSafe for AmqpAddress
impl Send for AmqpAddress
impl Sync for AmqpAddress
impl Unpin for AmqpAddress
impl UnsafeUnpin for AmqpAddress
impl UnwindSafe for AmqpAddress
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.