pub struct FileColorOutputPersistence { /* private fields */ }Expand description
A file holding one colour object’s Present_Value, replaced whole on each
save the same way as FileNotificationClassPersistence: a failed save
leaves the previous value in place, and a completed one survives a power
loss.
The file holds a magic tag, the object’s identifier, one octet naming the kind of value, and the value: two big-endian REALs for an xy colour, a big-endian 32-bit kelvin for a temperature. A file of the wrong size, of the other kind, or with a value outside the object’s range, does not load. It does not coordinate between processes.
Implementations§
Trait Implementations§
Source§impl Clone for FileColorOutputPersistence
impl Clone for FileColorOutputPersistence
Source§impl ColorOutputPersistence for FileColorOutputPersistence
Available on crate feature std only.
impl ColorOutputPersistence for FileColorOutputPersistence
Available on crate feature
std only.Source§fn load(
&self,
object: ObjectIdentifier,
) -> Result<Option<ColorOutputSnapshot>, Error>
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>
fn save( &self, object: ObjectIdentifier, snapshot: &ColorOutputSnapshot, ) -> Result<(), Error>
Durably replace what is saved for
object with snapshot.Auto Trait Implementations§
impl Freeze for FileColorOutputPersistence
impl RefUnwindSafe for FileColorOutputPersistence
impl Send for FileColorOutputPersistence
impl Sync for FileColorOutputPersistence
impl Unpin for FileColorOutputPersistence
impl UnsafeUnpin for FileColorOutputPersistence
impl UnwindSafe for FileColorOutputPersistence
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