#[non_exhaustive]pub enum PatchError {
EmptyLedger,
InvalidProfileTransition {
from: CatalogProfile,
to: CatalogProfile,
},
DuplicateId(String),
EditionMismatch {
patch_id: String,
patch_edition: CatalogEdition,
catalog_edition: CatalogEdition,
},
UnknownTemplate {
patch_id: String,
template: String,
},
AlreadyApplied {
patch_id: String,
template: String,
},
StaleTarget {
patch_id: String,
template: String,
},
NotAPropertySet {
patch_id: String,
template: String,
},
NotAQuantitySet {
patch_id: String,
template: String,
},
UnknownMember {
patch_id: String,
template: String,
member: String,
},
ConflictingApplicability {
template: String,
},
Catalog(CatalogError),
}Expand description
Why applying a patch ledger to a catalog failed.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
EmptyLedger
The supplied patch list was empty.
InvalidProfileTransition
The requested profile transition is not allowed, e.g. patching an
Official catalog into Official, or patching into Corrected when
the catalog is not a clean Official snapshot.
Fields
from: CatalogProfileThe catalog’s profile before this application.
to: CatalogProfileThe profile requested for the result.
DuplicateId(String)
Two patches in the ledger shared the same id.
EditionMismatch
A patch’s edition does not match the catalog’s edition.
Fields
patch_edition: CatalogEditionEdition the patch declares.
catalog_edition: CatalogEditionEdition of the catalog being patched.
UnknownTemplate
A patch’s target_template does not match any template Name in the catalog.
Fields
AlreadyApplied
An PatchOperation::AddApplicability selector, or a
PatchOperation::AddProperty member name, already exists on the target.
StaleTarget
A PatchOperation::ReplaceApplicability’s expected list, or a
PatchOperation::ReplaceQuantityKind or
PatchOperation::ReplacePropertyKind’s expected kind, did not
match the template’s current value.
NotAPropertySet
A PatchOperation::AddProperty or
PatchOperation::ReplacePropertyKind targets a quantity set template.
NotAQuantitySet
A PatchOperation::ReplaceQuantityKind targets a property set template.
UnknownMember
A PatchOperation::ReplaceQuantityKind or
PatchOperation::ReplacePropertyKind names a member the target lacks.
Fields
ConflictingApplicability
Two patches in the ledger both attempt to change the same template’s applicability in incompatible ways (e.g. add after replace).
Catalog(CatalogError)
Building the resulting catalog snapshot failed.
Trait Implementations§
Source§impl Clone for PatchError
impl Clone for PatchError
Source§fn clone(&self) -> PatchError
fn clone(&self) -> PatchError
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for PatchError
impl Debug for PatchError
Source§impl Display for PatchError
impl Display for PatchError
impl Eq for PatchError
Source§impl Error for PatchError
impl Error for PatchError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()