pub struct RouteRule {
pub matcher: PatternMatcher,
pub queue: String,
pub priority: i32,
pub routing_key: Option<String>,
pub exchange: Option<String>,
pub argument_condition: Option<ArgumentCondition>,
}Expand description
A routing rule that maps task names to queues
Fields§
§matcher: PatternMatcherPattern matcher for task names
queue: StringTarget queue name
priority: i32Rule priority (higher = evaluated first)
routing_key: Option<String>Optional routing key (for AMQP exchanges)
exchange: Option<String>Optional exchange name (for AMQP)
argument_condition: Option<ArgumentCondition>Optional argument condition for argument-based routing
Implementations§
Source§impl RouteRule
impl RouteRule
Sourcepub fn new(matcher: PatternMatcher, queue: impl Into<String>) -> Self
pub fn new(matcher: PatternMatcher, queue: impl Into<String>) -> Self
Create a new routing rule
Sourcepub fn with_priority(self, priority: i32) -> Self
pub fn with_priority(self, priority: i32) -> Self
Set the rule priority
Sourcepub fn with_routing_key(self, routing_key: impl Into<String>) -> Self
pub fn with_routing_key(self, routing_key: impl Into<String>) -> Self
Set the routing key (for AMQP)
Sourcepub fn with_exchange(self, exchange: impl Into<String>) -> Self
pub fn with_exchange(self, exchange: impl Into<String>) -> Self
Set the exchange name (for AMQP)
Sourcepub fn with_argument_condition(self, condition: ArgumentCondition) -> Self
pub fn with_argument_condition(self, condition: ArgumentCondition) -> Self
Set the argument condition for argument-based routing
Trait Implementations§
Auto Trait Implementations§
impl Freeze for RouteRule
impl RefUnwindSafe for RouteRule
impl Send for RouteRule
impl Sync for RouteRule
impl Unpin for RouteRule
impl UnwindSafe for RouteRule
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