pub struct MessageQueue { /* private fields */ }Expand description
Message queue for buffering raw message data
Supports both bounded and unbounded queues with optional message dropping.
Implementations§
Source§impl MessageQueue
impl MessageQueue
Sourcepub fn with_config(config: QueueConfig) -> Self
pub fn with_config(config: QueueConfig) -> Self
Create a new message queue with custom configuration
Sourcepub async fn dequeue(&self) -> Result<Vec<u8>>
pub async fn dequeue(&self) -> Result<Vec<u8>>
Dequeue a message (blocking until message available)
§Returns
Message bytes or error if queue is closed
Sourcepub async fn try_dequeue(&self) -> Result<Vec<u8>>
pub async fn try_dequeue(&self) -> Result<Vec<u8>>
Try to dequeue a message (non-blocking)
§Returns
Some(data) if message available, None if queue is empty
Sourcepub async fn stats(&self) -> QueueStats
pub async fn stats(&self) -> QueueStats
Get queue statistics
Sourcepub fn config(&self) -> &QueueConfig
pub fn config(&self) -> &QueueConfig
Get queue configuration
Trait Implementations§
Auto Trait Implementations§
impl Freeze for MessageQueue
impl !RefUnwindSafe for MessageQueue
impl Send for MessageQueue
impl Sync for MessageQueue
impl Unpin for MessageQueue
impl !UnwindSafe for MessageQueue
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