#[non_exhaustive]pub enum MetropolisMoveApplicationFailure {
BackendMutation {
operation: BackendMutationOperation,
target: String,
detail: String,
},
BackendRollback {
operation: BackendMutationOperation,
target: String,
detail: String,
rollback_errors: String,
},
DelaunayValidation {
level: DelaunayValidationLevel,
detail: String,
},
Validation {
check: CdtValidationCheck,
failure: CdtValidationFailure,
},
TopologyMismatch {
topology: CdtTopology,
euler_characteristic: i128,
expected_euler_characteristics: Vec<i128>,
vertices: usize,
edges: usize,
faces: usize,
},
Foliation(FoliationError),
CausalityViolation {
time_0: u32,
time_1: u32,
step_distance: u32,
},
Unexpected {
detail: String,
},
}Expand description
Lower-level source for a Metropolis-accepted move that could not be applied.
CdtError::MetropolisMoveApplicationFailed uses this enum to preserve the
category and structured context of a hard failure after Metropolis has
accepted a move type. It is intentionally smaller than recursively storing a
full CdtError while still giving callers typed branches for backend,
validation, topology, foliation, and causality failures.
§Examples
use causal_triangulations::prelude::errors::{
BackendMutationOperation, MetropolisMoveApplicationFailure,
};
let failure = MetropolisMoveApplicationFailure::BackendMutation {
operation: BackendMutationOperation::RemoveVertex,
target: "vertex VertexKey(7v1)".to_string(),
detail: "backend reported invalid vertex key".to_string(),
};
assert!(format!("{failure}").contains("remove_vertex"));Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
BackendMutation
A backend payload or topology edit failed while applying the accepted move.
Fields
operation: BackendMutationOperationMutation operation being attempted.
BackendRollback
A backend mutation failed, then rollback of staged payloads also failed.
Fields
operation: BackendMutationOperationMutation operation being attempted when the first failure occurred.
DelaunayValidation
Upstream Delaunay validation rejected the evolved geometry.
Fields
level: DelaunayValidationLevelCumulative upstream validation level being enforced.
Validation
CDT validation rejected the evolved triangulation.
Fields
check: CdtValidationCheckValidation check that failed.
failure: CdtValidationFailureStructured validation failure detail.
TopologyMismatch
Topology metadata did not match the evolved backend Euler characteristic.
Fields
topology: CdtTopologyTopology requested by CDT metadata.
Foliation(FoliationError)
Foliation bookkeeping or validation failed.
CausalityViolation
A post-mutation edge violated CDT causality.
Fields
Unexpected
A hard failure reached the Metropolis boundary through an unexpected error category.
Trait Implementations§
Source§impl Clone for MetropolisMoveApplicationFailure
impl Clone for MetropolisMoveApplicationFailure
Source§fn clone(&self) -> MetropolisMoveApplicationFailure
fn clone(&self) -> MetropolisMoveApplicationFailure
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Error for MetropolisMoveApplicationFailure
impl Error for MetropolisMoveApplicationFailure
1.30.0 · 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()
Source§impl PartialEq for MetropolisMoveApplicationFailure
impl PartialEq for MetropolisMoveApplicationFailure
Source§fn eq(&self, other: &MetropolisMoveApplicationFailure) -> bool
fn eq(&self, other: &MetropolisMoveApplicationFailure) -> bool
self and other values to be equal, and is used by ==.