Skip to main content

NotificationForwarderPersistence

Trait NotificationForwarderPersistence 

Source
pub trait NotificationForwarderPersistence: Send + Sync {
    // Required methods
    fn load(
        &self,
        forwarder: ObjectIdentifier,
    ) -> Result<Option<ForwarderSnapshot>, Error>;
    fn save(
        &self,
        forwarder: ObjectIdentifier,
        snapshot: &ForwarderSnapshot,
    ) -> Result<(), Error>;
}
Expand description

Application-owned storage for one Notification Forwarder’s lists.

The forwarder calls it from its writer thread, one call at a time. A written list lands in storage a moment before the forwarder serves it: see storage leads the served state.

Required Methods§

Source

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>

Durably replace what is saved for forwarder with snapshot.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§