pub struct Store { /* private fields */ }Implementations§
Source§impl Store
impl Store
Sourcepub async fn enqueue(&self, recipient: String, value: Vec<u8>) -> Result<String>
pub async fn enqueue(&self, recipient: String, value: Vec<u8>) -> Result<String>
Append value to recipient’s queue; returns the ack key.
Sourcepub async fn peek_oldest(
&self,
recipient: String,
) -> Result<Option<(String, Vec<u8>)>>
pub async fn peek_oldest( &self, recipient: String, ) -> Result<Option<(String, Vec<u8>)>>
The oldest un-acked (key, value) for recipient, without removing it.
Sourcepub async fn ack(&self, key: String) -> Result<()>
pub async fn ack(&self, key: String) -> Result<()>
Remove an acked message by key. Idempotent (removing an absent key is ok).
Sourcepub async fn depth(&self, recipient: String) -> Result<usize>
pub async fn depth(&self, recipient: String) -> Result<usize>
Count of un-acked messages for recipient.
Sourcepub async fn list(&self, recipient: String) -> Result<Vec<(String, Vec<u8>)>>
pub async fn list(&self, recipient: String) -> Result<Vec<(String, Vec<u8>)>>
Every un-acked (key, value) for recipient, in FIFO order. Used to
inspect a queue (e.g. list what’s still pending in the agent’s outbox).
Sourcepub async fn log_put(&self, rec: LogRecord) -> Result<()>
pub async fn log_put(&self, rec: LogRecord) -> Result<()>
Insert or overwrite a log record (keyed by msg_id) and its per-peer index.
Sourcepub async fn log_set_state(&self, msg_id: String, state: String) -> Result<()>
pub async fn log_set_state(&self, msg_id: String, state: String) -> Result<()>
Update the state of a logged message. No-op if the msg_id is unknown.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Store
impl !UnwindSafe for Store
impl Freeze for Store
impl Send for Store
impl Sync for Store
impl Unpin for Store
impl UnsafeUnpin for Store
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