pub struct QueueConfig {
pub name: QueueName,
pub durable: bool,
pub auto_delete: bool,
pub max_messages: Option<u64>,
pub max_message_size: Option<u64>,
pub message_ttl: Option<u64>,
pub dead_letter_queue: Option<QueueName>,
}Expand description
队列配置
Fields§
§name: QueueName队列名称
durable: bool是否持久化
auto_delete: bool是否自动删除 (当没有消费者时)
max_messages: Option<u64>最大消息数
max_message_size: Option<u64>最大消息大小 (字节)
message_ttl: Option<u64>消息存活时间 (毫秒)
dead_letter_queue: Option<QueueName>死信队列
Implementations§
Source§impl QueueConfig
impl QueueConfig
Sourcepub fn auto_delete(self, auto_delete: bool) -> Self
pub fn auto_delete(self, auto_delete: bool) -> Self
设置自动删除
Sourcepub fn max_messages(self, max: u64) -> Self
pub fn max_messages(self, max: u64) -> Self
设置最大消息数
Sourcepub fn message_ttl(self, ttl_ms: u64) -> Self
pub fn message_ttl(self, ttl_ms: u64) -> Self
设置消息 TTL
Sourcepub fn dead_letter_queue(self, queue: impl Into<String>) -> Self
pub fn dead_letter_queue(self, queue: impl Into<String>) -> Self
设置死信队列
Trait Implementations§
Source§impl Clone for QueueConfig
impl Clone for QueueConfig
Source§fn clone(&self) -> QueueConfig
fn clone(&self) -> QueueConfig
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 moreAuto Trait Implementations§
impl Freeze for QueueConfig
impl RefUnwindSafe for QueueConfig
impl Send for QueueConfig
impl Sync for QueueConfig
impl Unpin for QueueConfig
impl UnsafeUnpin for QueueConfig
impl UnwindSafe for QueueConfig
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