daemonic_error 0.1.0

Errors that compose, predict, and leave receipts - Compose: algebraic combination (in active development) - Predict: Glass/Severity - Receipts: audit trail, position, checksum - Reflection: Runtime Reflection through TopologySegment (in active development)
use crate::daemonic::glass::Glass;
use crate::DaemonicError;

/// Irreversible transformation. State cannot be trusted.
/// What came back is not what was sent.
/// Non-reversible by definition.
pub trait GlassWarp<GLASS>: Glass<GLASS> + for<'error> DaemonicError <'error> {
	/// What was the state before warping? (if recoverable for inspection)
	fn prior_state(&self) -> Option<&GLASS>;

	/// What caused the warp?
	fn warp_description(&self) -> &str;
}
/// Annotation on a Warp observation.
/// "State is corrupted, here's the transformation that happened."
pub trait WarpAnnotation<GLASS>: GlassWarp<GLASS> {
	fn annotation(&self) -> &str;

	/// Description of the transformation.
	fn transformation_description(&self) -> &str;
}