pub struct RabbitExchange { /* private fields */ }Expand description
Describes the exchange side of a RabbitQueue binding.
Like every descriptor in this crate it only records the EXPECTED topology; nothing is
declared unless the broker was built with
declare_topology(true).
§Examples
use ruststream_lapin::RabbitExchange;
let events = RabbitExchange::topic("events").durable(true);
assert_eq!(events.name(), "events");Implementations§
Source§impl RabbitExchange
impl RabbitExchange
Sourcepub fn direct(name: impl Into<String>) -> Self
pub fn direct(name: impl Into<String>) -> Self
A direct exchange: routes on an exact routing-key match.
Sourcepub fn topic(name: impl Into<String>) -> Self
pub fn topic(name: impl Into<String>) -> Self
A topic exchange: routes on dot-separated routing-key patterns (order.*).
Sourcepub fn fanout(name: impl Into<String>) -> Self
pub fn fanout(name: impl Into<String>) -> Self
A fanout exchange: routes every message to every bound queue.
Sourcepub fn headers(name: impl Into<String>) -> Self
pub fn headers(name: impl Into<String>) -> Self
A headers exchange: routes on header attributes instead of the routing key.
Sourcepub fn custom(name: impl Into<String>, kind: impl Into<String>) -> Self
pub fn custom(name: impl Into<String>, kind: impl Into<String>) -> Self
An exchange of a plugin-provided type, for example "x-delayed-message".
Sourcepub fn durable(self, durable: bool) -> Self
pub fn durable(self, durable: bool) -> Self
Whether the exchange survives a broker restart. Defaults to true.
Sourcepub fn auto_delete(self, auto_delete: bool) -> Self
pub fn auto_delete(self, auto_delete: bool) -> Self
Whether the exchange is deleted when its last binding is removed. Defaults to false.
Trait Implementations§
Source§impl Clone for RabbitExchange
impl Clone for RabbitExchange
Source§fn clone(&self) -> RabbitExchange
fn clone(&self) -> RabbitExchange
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 RabbitExchange
impl Debug for RabbitExchange
impl Eq for RabbitExchange
Source§impl PartialEq for RabbitExchange
impl PartialEq for RabbitExchange
Source§fn eq(&self, other: &RabbitExchange) -> bool
fn eq(&self, other: &RabbitExchange) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for RabbitExchange
Auto Trait Implementations§
impl Freeze for RabbitExchange
impl RefUnwindSafe for RabbitExchange
impl Send for RabbitExchange
impl Sync for RabbitExchange
impl Unpin for RabbitExchange
impl UnsafeUnpin for RabbitExchange
impl UnwindSafe for RabbitExchange
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