pub struct RawQueue { /* private fields */ }
Expand description
A FIFO queue Optionally has a server side time to live
Implementations§
Source§impl RawQueue
impl RawQueue
Sourcepub async fn push_batch(
&self,
data: impl Iterator<Item = &[u8]>,
) -> Result<(), ErrorTypes>
pub async fn push_batch( &self, data: impl Iterator<Item = &[u8]>, ) -> Result<(), ErrorTypes>
enqueue a sequence of items
Sourcepub async fn unpop(&self, data: &[u8]) -> Result<(), ErrorTypes>
pub async fn unpop(&self, data: &[u8]) -> Result<(), ErrorTypes>
Put all messages passed back at the head of the FIFO queue.
Sourcepub async fn length(&self) -> Result<usize, ErrorTypes>
pub async fn length(&self) -> Result<usize, ErrorTypes>
Read the number of items in the queue
Sourcepub async fn peek_next(&self) -> Result<Option<Vec<u8>>, ErrorTypes>
pub async fn peek_next(&self) -> Result<Option<Vec<u8>>, ErrorTypes>
load the item that would be returned by the next call to pop
Sourcepub async fn content(&self) -> Result<Vec<Vec<u8>>, ErrorTypes>
pub async fn content(&self) -> Result<Vec<Vec<u8>>, ErrorTypes>
Load the entire content of the queue into memory
Sourcepub async fn delete(&self) -> Result<(), ErrorTypes>
pub async fn delete(&self) -> Result<(), ErrorTypes>
Clear all data for this object
Sourcepub async fn pop(&self) -> Result<Option<Vec<u8>>, ErrorTypes>
pub async fn pop(&self) -> Result<Option<Vec<u8>>, ErrorTypes>
dequeue an item from the front of the queue, returning immediately if empty
Sourcepub async fn pop_timeout(
&self,
timeout: Duration,
) -> Result<Option<Vec<u8>>, ErrorTypes>
pub async fn pop_timeout( &self, timeout: Duration, ) -> Result<Option<Vec<u8>>, ErrorTypes>
Make a blocking pop call with a timeout
Trait Implementations§
Auto Trait Implementations§
impl Freeze for RawQueue
impl !RefUnwindSafe for RawQueue
impl Send for RawQueue
impl Sync for RawQueue
impl Unpin for RawQueue
impl !UnwindSafe for RawQueue
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