pub struct QoxideQueue { /* private fields */ }Expand description
Implementations§
Source§impl QoxideQueue
impl QoxideQueue
Sourcepub fn new() -> Self
pub fn new() -> Self
Creates a new in-memory queue.
Data is lost when the queue is dropped. For persistence, use new_with_path.
Sourcepub fn new_with_path(path: &str) -> Self
pub fn new_with_path(path: &str) -> Self
Creates a new file-backed queue at the given path.
Enables WAL mode for better concurrent read performance. The database file is created if it doesn’t exist.
Sourcepub fn reserve(&mut self) -> Result<(i64, Vec<u8>), Error>
pub fn reserve(&mut self) -> Result<(i64, Vec<u8>), Error>
Atomically reserves the next pending message.
Returns the message ID and payload. The message state changes from Pending to Reserved.
Returns an error if no pending messages are available.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for QoxideQueue
impl !RefUnwindSafe for QoxideQueue
impl Send for QoxideQueue
impl !Sync for QoxideQueue
impl Unpin for QoxideQueue
impl !UnwindSafe for QoxideQueue
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