pub trait AccessRightsPersistence: Send + Sync {
// Required methods
fn load(
&self,
rights: ObjectIdentifier,
) -> Result<Option<AccessRightsSnapshot>, Error>;
fn save(
&self,
rights: ObjectIdentifier,
snapshot: &AccessRightsSnapshot,
) -> Result<(), Error>;
}Expand description
Application-owned storage for one Access Rights object’s rule arrays, Enable and Accompaniment.
The object calls it from its writer thread, one call at a time. A written value lands in storage a moment before the object serves it: see storage leads the served state.
Required Methods§
Sourcefn load(
&self,
rights: ObjectIdentifier,
) -> Result<Option<AccessRightsSnapshot>, Error>
fn load( &self, rights: ObjectIdentifier, ) -> Result<Option<AccessRightsSnapshot>, Error>
What was last saved for rights, or None when nothing was saved.
Sourcefn save(
&self,
rights: ObjectIdentifier,
snapshot: &AccessRightsSnapshot,
) -> Result<(), Error>
fn save( &self, rights: ObjectIdentifier, snapshot: &AccessRightsSnapshot, ) -> Result<(), Error>
Durably replace what is saved for rights with snapshot.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".