daemonic_error 1.0.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 alloc::boxed::Box;
use crate::{daemonic::{
	frame::{Frame, FrameType, ReferenceFrame},
	glass::{Glass, Observation},
	Anchor,
	AnchorDomainSet,
	SymbolicAnchor,
	TopologySegment,
}, DaemonicError, SemanticAnchor, DaemonicEmission};
pub use daemonic::*;
pub use generic::*;
use crate::compiler::DaemonicC;

pub mod compiler;
impl Frame for Error {
	fn frame_type(&self) -> FrameType {
		todo!()
	}
}
impl Anchor for Error {
	fn anchor_domains(&self) -> AnchorDomainSet {
		todo!()
	}
}
impl ReferenceFrame for Error {
	fn origin(&self) -> &TopologySegment {
		todo!()
	}
}
pub enum Error {
	/// Use generic variant for simple or quick errors
	Generic(GenericVariants),
	/// Use this variant for LIBC compatible errors with ERRNO table and conversion methods
	OS(os::OsError),
	/// Daemonic Error variants with richer context than Generic or OS level returns
	/// Shade, Entity, and Symbolic errors are here.
	Daemonic(DaemonicVariants),
	Compiler(DaemonicC),
}
impl Error {
	// pub fn build_from_topology(error_topology: &TopologySegment, build_topology: &TopologySegment) -> Self {
	// 	match error_topology.label {
	// "Daemonic::Glass::Error::Daemonic::Glass::Cracked<GLASS>" => {
	// this shit probably isnt right so im going to just say fuck it and loop back later with a different plan
	// Error::Daemonic(
	// 	DaemonicVariants::Glass(
	// 		GlassError::GlassOBSStructs(
	// 			DaemonicEmission {
	// 				inner: Box::new(crate::daemonic::observation::Stable::new(
	// 					Error(DaemonicVariants::Glass(GlassError::GlassOBSStructs())),
	// 					build_topology))
	// 			})))
	// Error::Daemonic(DaemonicVariants::Glass(GlassError::GlassStates(emission)))
	// }
	// "Daemonic::Glass::Error::Daemonic::Glass::Fractured<GLASS>"     => {}
	// "Daemonic::Glass::Error::Daemonic::Glass::Drift<GLASS>"         => {}
	// "Daemonic::Glass::Error::Daemonic::Glass::Echo<GLASS>"          => {}
	// "Daemonic::Glass::Error::Daemonic::Glass::Opaque<GLASS>"        => {}
	// "Daemonic::Glass::Error::Daemonic::Glass::Warped<GLASS>"        => {}
	// "Daemonic::Glass::Error::Daemonic::Glass::Impossible<(!)>"      => {}
	// "Daemonic::Glass::Error::Daemonic::Glass::Shattered"            => {}
	// "Daemonic::Glass::Error::Daemonic::Glass::Paradox<GLASS>"       => {}
	// "Daemonic::Glass::Error::Daemonic::Glass::Unknown<GLASS>"       => {}
	// "Daemonic::GenericVariants::" => {}
	// "Daemonic::OS::" => {}
	// "Daemonic::DaemonicVariants::" => {}
	// 		_ => {
	// 			Self // this is a stub
	// 		}
	// 	}
	// }
	// pub fn build_cracked_emission<GLASS>(payload: Option<GLASS>, error_top: &TopologySegment, emission_top: &TopologySegment) -> Error {
	// 	Error::Daemonic(DaemonicVariants::Glass(GlassError::GlassOBSStructs(
	// 		DaemonicEmission::new(crate::daemonic::observation::Stable::new((), emission_top)
	// 		))))
	// }
}
static ERROR_SEGMENT: TopologySegment = TopologySegment::new("Daemonic::Glass::Error");
impl<'error> DaemonicError<'error> for Error {
	fn emit(self) -> DaemonicEmission {
		todo!("needs shit")
	}
	
	fn position(&self) -> &TopologySegment {
		&ERROR_SEGMENT
	}
}
pub mod os;
pub mod daemonic;
pub mod generic;
pub mod physics_violation;