Skip to main content

ColorOutputPersistence

Trait ColorOutputPersistence 

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

Application-owned storage for one colour object’s Present_Value.

The object calls load once, as it takes the storage, and save from its writer thread, one call at a time. A backend that refuses a save returns an error and keeps what it held.

Required Methods§

Source

fn load( &self, object: ObjectIdentifier, ) -> Result<Option<ColorOutputSnapshot>, Error>

What was last saved for object, or None when nothing was saved.

Source

fn save( &self, object: ObjectIdentifier, snapshot: &ColorOutputSnapshot, ) -> Result<(), Error>

Durably replace what is saved for object with snapshot.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§

Source§

impl ColorOutputPersistence for FileColorOutputPersistence

Available on crate feature std only.