pub struct QueueConfig {
pub name: String,
pub mode: QueueMode,
pub durable: bool,
pub auto_delete: bool,
pub max_message_size: Option<usize>,
pub message_ttl: Option<Duration>,
}Expand description
Queue configuration
§Examples
use celers_kombu::{QueueConfig, QueueMode};
use std::time::Duration;
let config = QueueConfig::new("my_queue".to_string())
.with_mode(QueueMode::Priority)
.with_ttl(Duration::from_secs(3600))
.with_durable(true)
.with_max_message_size(1024 * 1024);
assert_eq!(config.name, "my_queue");
assert_eq!(config.mode, QueueMode::Priority);
assert_eq!(config.message_ttl, Some(Duration::from_secs(3600)));
assert!(config.durable);
assert_eq!(config.max_message_size, Some(1024 * 1024));Fields§
§name: StringQueue name
mode: QueueModeQueue mode
durable: boolDurable (survive broker restart)
auto_delete: boolAuto-delete (delete when no consumers)
max_message_size: Option<usize>Maximum message size
message_ttl: Option<Duration>Message TTL (time-to-live)
Implementations§
Source§impl QueueConfig
impl QueueConfig
pub fn new(name: String) -> Self
pub fn with_mode(self, mode: QueueMode) -> Self
pub fn with_ttl(self, ttl: Duration) -> Self
Sourcepub fn with_durable(self, durable: bool) -> Self
pub fn with_durable(self, durable: bool) -> Self
Set durability
Sourcepub fn with_auto_delete(self, auto_delete: bool) -> Self
pub fn with_auto_delete(self, auto_delete: bool) -> Self
Set auto-delete
Sourcepub fn with_max_message_size(self, size: usize) -> Self
pub fn with_max_message_size(self, size: usize) -> Self
Set max message size
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