Skip to main content

MetropolisMoveApplicationFailure

Enum MetropolisMoveApplicationFailure 

Source
#[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
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

BackendMutation

A backend payload or topology edit failed while applying the accepted move.

Fields

§operation: BackendMutationOperation

Mutation operation being attempted.

§target: String

Human-readable target handle.

§detail: String

Additional failure detail.

§

BackendRollback

A backend mutation failed, then rollback of staged payloads also failed.

Fields

§operation: BackendMutationOperation

Mutation operation being attempted when the first failure occurred.

§target: String

Human-readable target handle for the first failure.

§detail: String

Primary mutation failure detail.

§rollback_errors: String

Rollback failure details for one or more payloads.

§

DelaunayValidation

Upstream Delaunay validation rejected the evolved geometry.

Fields

§level: DelaunayValidationLevel

Cumulative upstream validation level being enforced.

§detail: String

Upstream validation diagnostic.

§

Validation

CDT validation rejected the evolved triangulation.

Fields

§check: CdtValidationCheck

Validation check that failed.

§failure: CdtValidationFailure

Structured validation failure detail.

§

TopologyMismatch

Topology metadata did not match the evolved backend Euler characteristic.

Fields

§topology: CdtTopology

Topology requested by CDT metadata.

§euler_characteristic: i128

Observed Euler characteristic from the backend.

§expected_euler_characteristics: Vec<i128>

Accepted Euler characteristics for the requested topology.

§vertices: usize

Backend vertex count at validation time.

§edges: usize

Backend edge count at validation time.

§faces: usize

Backend face count at validation time.

§

Foliation(FoliationError)

Foliation bookkeeping or validation failed.

§

CausalityViolation

A post-mutation edge violated CDT causality.

Fields

§time_0: u32

Time label of the first endpoint.

§time_1: u32

Time label of the second endpoint.

§step_distance: u32

Topology-aware temporal step distance between the two labels.

§

Unexpected

A hard failure reached the Metropolis boundary through an unexpected error category.

Fields

§detail: String

Lower-level error text retained for diagnostics.

Trait Implementations§

Source§

impl Clone for MetropolisMoveApplicationFailure

Source§

fn clone(&self) -> MetropolisMoveApplicationFailure

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for MetropolisMoveApplicationFailure

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Display for MetropolisMoveApplicationFailure

Source§

fn fmt(&self, __formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Error for MetropolisMoveApplicationFailure

1.30.0 · Source§

fn source(&self) -> Option<&(dyn Error + 'static)>

Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§

fn description(&self) -> &str

👎Deprecated since 1.42.0:

use the Display impl or to_string()

1.0.0 · Source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0:

replaced by Error::source, which can support downcasting

Source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type-based access to context intended for error reports. Read more
Source§

impl From<CdtError> for MetropolisMoveApplicationFailure

Source§

fn from(error: CdtError) -> Self

Converts to this type from the input type.
Source§

impl PartialEq for MetropolisMoveApplicationFailure

Source§

fn eq(&self, other: &MetropolisMoveApplicationFailure) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl StructuralPartialEq for MetropolisMoveApplicationFailure

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> DataDebug for T
where T: Debug,