pub struct MailInbox { /* private fields */ }Expand description
Cross-route letter deduplication. The application stores accepted letters;
persist the inbox snapshot with them before deleting relay copies or acting.
accept never executes content or sends replies.
Implementations§
Source§impl MailInbox
impl MailInbox
pub fn new(keyring: MailKeyring) -> Self
pub fn keyring(&self) -> &MailKeyring
pub fn keyring_mut(&mut self) -> &mut MailKeyring
pub fn has(&self, letter_id: &str) -> bool
pub fn accept( &mut self, packet: &Packet, claimed_packet_id: Option<&str>, now: i64, ) -> Result<InboxAcceptance>
Sourcepub fn prune(&mut self, now: i64) -> Result<()>
pub fn prune(&mut self, now: i64) -> Result<()>
Forget letters whose signed expiration passed; they can no longer be newly accepted.
pub fn snapshot(&self) -> Result<Value>
pub fn from_snapshot(keyring: MailKeyring, value: &Value) -> Result<Self>
Auto Trait Implementations§
impl Freeze for MailInbox
impl RefUnwindSafe for MailInbox
impl Send for MailInbox
impl Sync for MailInbox
impl Unpin for MailInbox
impl UnsafeUnpin for MailInbox
impl UnwindSafe for MailInbox
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