pub struct FileNotificationForwarderPersistence { /* private fields */ }Expand description
A file holding one forwarder’s lists, replaced whole on each save.
A save writes a sibling .tmp file, synchronizes it, renames it over the
old one and then synchronizes the directory, so a failed save leaves the
previous lists in place and a completed one survives a power loss. Once
the rename succeeds the save has landed: a directory sync that fails is
logged, not returned. (On Windows the directory is not synchronized: see
the durable module.) The file holds a magic tag, the
forwarder’s object identifier, whether a Recipient_List follows, the
encoded Recipient_List with its length, and the encoded
Subscribed_Recipients. It does not coordinate between processes.
Implementations§
Trait Implementations§
Source§impl NotificationForwarderPersistence for FileNotificationForwarderPersistence
impl NotificationForwarderPersistence for FileNotificationForwarderPersistence
Source§fn load(
&self,
forwarder: ObjectIdentifier,
) -> Result<Option<ForwarderSnapshot>, Error>
fn load( &self, forwarder: ObjectIdentifier, ) -> Result<Option<ForwarderSnapshot>, Error>
The lists last saved for
forwarder, or None when nothing was
saved.Source§fn save(
&self,
forwarder: ObjectIdentifier,
snapshot: &ForwarderSnapshot,
) -> Result<(), Error>
fn save( &self, forwarder: ObjectIdentifier, snapshot: &ForwarderSnapshot, ) -> Result<(), Error>
Durably replace what is saved for
forwarder with snapshot.Auto Trait Implementations§
impl Freeze for FileNotificationForwarderPersistence
impl RefUnwindSafe for FileNotificationForwarderPersistence
impl Send for FileNotificationForwarderPersistence
impl Sync for FileNotificationForwarderPersistence
impl Unpin for FileNotificationForwarderPersistence
impl UnsafeUnpin for FileNotificationForwarderPersistence
impl UnwindSafe for FileNotificationForwarderPersistence
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