pub struct ServerOutbox {
pub conn: Connection,
}Expand description
Access to the outbox table.
Fields§
§conn: ConnectionImplementations§
Source§impl ServerOutbox
impl ServerOutbox
Sourcepub fn enqueue(&mut self, date: NaiveDate, error: &str) -> Result<()>
pub fn enqueue(&mut self, date: NaiveDate, error: &str) -> Result<()>
Records date as owed, or notes another failed attempt at it.
Safe to call for a date already queued: the row is updated rather than duplicated.
Sourcepub fn pending(&self) -> Result<Vec<OwedDay>>
pub fn pending(&self) -> Result<Vec<OwedDay>>
Every day still owed, oldest first.
Oldest first because a backlog is delivered in the order it happened: a dashboard filling in from the far end reads as a machine catching up, one filling in at random reads as a machine malfunctioning.
Sourcepub fn remove(&mut self, date: NaiveDate) -> Result<bool>
pub fn remove(&mut self, date: NaiveDate) -> Result<bool>
Forgets date, whether it was delivered or given up on.
One method for both outcomes on purpose: the queue’s business is whether a day is still owed, and a day the server will never accept is no more owed than one it has taken. Which of the two happened is said out loud by the caller, where the user can see it.
Auto Trait Implementations§
impl !Freeze for ServerOutbox
impl !RefUnwindSafe for ServerOutbox
impl !Sync for ServerOutbox
impl !UnwindSafe for ServerOutbox
impl Send for ServerOutbox
impl Unpin for ServerOutbox
impl UnsafeUnpin for ServerOutbox
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