mod artifact_commit;
mod attempt_journal;
mod command_lifetime_lock;
mod consistency;
mod download_journal;
mod effect_graph;
mod execution_settlement;
mod fence_obligation;
mod file_lock;
mod inventory;
mod journal_lock;
mod json;
mod layout_lifetime;
mod operation_plan;
mod restore_safety;
pub use artifact_commit::{ArtifactCommitOutcome, commit_artifact_directory};
pub use attempt_journal::{AttemptJournalError, AttemptJournalGuard};
pub use command_lifetime_lock::{
COMMAND_CUSTODY_DESCRIPTOR_ENV, CommandLifetimeLock, CommandLifetimeLockError,
CommandQuiescenceGuard,
};
pub use consistency::{
ConsistencyPersistenceError, create_consistency_requirement, read_consistency_requirement,
};
pub use download_journal::{
DownloadIntegrityError, DownloadJournalError, DownloadJournalGuard, DownloadManifestError,
LocalRestoreArtifactError, LocalRestoreArtifactPublicationError, LocalRestoreArtifactView,
LocalRestoreSourceError, read_download_manifest,
};
#[cfg(unix)]
pub use download_journal::{
IcSnapshotArtifactError, IcSnapshotArtifactWriter, IcSnapshotLocalMetrics,
IcSnapshotUploadArtifactError,
};
pub use effect_graph::{EffectGraphPersistenceError, create_effect_graph, read_effect_graph};
pub use execution_settlement::{
ExecutionSettlementPersistenceError, create_execution_settlement, read_execution_settlement,
};
pub use fence_obligation::{
FenceObligationPersistenceError, FenceObligationRequirement, create_fence_obligation,
read_fence_obligation,
};
pub use inventory::{InventoryError, create_inventory, read_inventory};
pub use journal_lock::{JournalLock, JournalLockError};
pub use json::{create_json_durable, read_json, write_json_durable};
pub use layout_lifetime::{BackupLayoutGuard, MAX_RESTORE_REFERENCE_BYTES};
pub use operation_plan::{
OperationPlanPersistenceError, create_operation_plan, read_operation_plan,
};
pub use restore_safety::{
RestoreSafetyPersistenceError, create_restore_safety_requirement,
read_restore_safety_requirement,
};
use crate::{model::artifacts::ChecksumError, ops::artifacts::ArtifactError};
use std::io;
use thiserror::Error;
#[derive(Debug, Error)]
pub enum PersistenceError {
#[error("backup layout changed while held: {path:?}")]
LayoutChanged {
path: std::path::PathBuf,
},
#[error("unsafe restore reference entry: {path:?}")]
InvalidRestoreReferences {
path: std::path::PathBuf,
},
#[error(transparent)]
RestoreReference(#[from] crate::model::restore_references::RestoreReferenceError),
#[error(transparent)]
Io(#[from] io::Error),
#[error(transparent)]
Json(#[from] serde_json::Error),
#[error("record exceeds byte limit {limit}")]
RecordTooLarge {
limit: u64,
},
#[error(transparent)]
Artifact(#[from] ArtifactError),
#[error(transparent)]
Checksum(#[from] ChecksumError),
#[error("artifact commit paths must be distinct siblings: {temporary}, {canonical}")]
ArtifactCommitPathMismatch {
temporary: String,
canonical: String,
},
#[error("artifact commit has conflicting paths: {temporary}, {canonical}")]
ArtifactCommitPathConflict {
temporary: String,
canonical: String,
},
#[error("artifact commit is missing both paths: {temporary}, {canonical}")]
ArtifactCommitPathMissing {
temporary: String,
canonical: String,
},
#[error("durable artifact publication is unsupported on {platform}")]
ArtifactCommitUnsupportedPlatform {
platform: &'static str,
},
#[error("unsupported artifact entry at {path}: {kind}")]
UnsupportedArtifactEntry {
path: String,
kind: String,
},
}