daemonic_error 0.1.1

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, Severity};
use crate::DaemonicError;

/// glass state changed during observation.
/// The observation is smeared across a fidelity transition.
/// Need both the starting and ending state to interpret.
pub trait GlassDrift<GLASS>: Glass<GLASS> + for<'error> DaemonicError<'error> {
	/// What severity did we start at?
	fn from_severity(&self) -> Severity;

	/// What severity did we end at?
	fn to_severity(&self) -> Severity;
}
/// Annotation on a Drift observation.
/// "The glass changed during observation, here's the transition."
pub trait DriftAnnotation<GLASS>: GlassDrift<GLASS> {
	fn annotation(&self) -> &str;

	/// What triggered the state change mid-observation?
	fn drift_trigger(&self) -> Option<&str> { None }
}