pub struct TopicExchangeConfig {
pub name: String,
pub bindings: HashMap<String, String>,
pub default_queue: Option<String>,
pub durable: bool,
pub auto_delete: bool,
}Expand description
Topic exchange configuration for declarative setup
Fields§
§name: StringExchange name
bindings: HashMap<String, String>Topic bindings: pattern -> queue
default_queue: Option<String>Default queue for unmatched topics
durable: boolWhether the exchange is durable
auto_delete: boolWhether to auto-delete when unused
Implementations§
Source§impl TopicExchangeConfig
impl TopicExchangeConfig
Sourcepub fn with_binding(
self,
pattern: impl Into<String>,
queue: impl Into<String>,
) -> Self
pub fn with_binding( self, pattern: impl Into<String>, queue: impl Into<String>, ) -> Self
Add a topic binding
Sourcepub fn with_default_queue(self, queue: impl Into<String>) -> Self
pub fn with_default_queue(self, queue: impl Into<String>) -> Self
Set default queue
Sourcepub fn with_durable(self, durable: bool) -> Self
pub fn with_durable(self, durable: bool) -> Self
Set durable flag
Sourcepub fn build_router(&self) -> TopicRouter
pub fn build_router(&self) -> TopicRouter
Build a topic router from this configuration
Trait Implementations§
Source§impl Clone for TopicExchangeConfig
impl Clone for TopicExchangeConfig
Source§fn clone(&self) -> TopicExchangeConfig
fn clone(&self) -> TopicExchangeConfig
Returns a duplicate of the value. Read more
1.0.0 · 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 TopicExchangeConfig
impl Debug for TopicExchangeConfig
Source§impl<'de> Deserialize<'de> for TopicExchangeConfig
impl<'de> Deserialize<'de> for TopicExchangeConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for TopicExchangeConfig
impl RefUnwindSafe for TopicExchangeConfig
impl Send for TopicExchangeConfig
impl Sync for TopicExchangeConfig
impl Unpin for TopicExchangeConfig
impl UnwindSafe for TopicExchangeConfig
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