pub trait AlbumStoreFile: Sized {
// Required methods
fn path(root: &Path) -> PathBuf;
fn load(
root: &Path,
master: &MasterKey,
) -> Result<Option<Self>, AlbumStoreError>;
fn save(
&self,
root: &Path,
master: &MasterKey,
) -> Result<(), AlbumStoreError>;
}Expand description
Reading and durably replacing an [AlbumStore] on disk.
Required Methods§
Sourcefn load(
root: &Path,
master: &MasterKey,
) -> Result<Option<Self>, AlbumStoreError>
fn load( root: &Path, master: &MasterKey, ) -> Result<Option<Self>, AlbumStoreError>
Load and unseal the store at {root}/.library/albums.cbor.
Ok(None) means the file does not exist — a library written before album keys were
durable, whose album keys were session-scoped and were therefore never persisted. Such
a library opens with zero albums; its assets are recoverable only through a backup artifact (see
Workspace::import_backup). This is not a
regression — those assets were already undecryptable across a restart before the store
existed — but it is a real, permanent limitation of libraries created before it.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".