use alloc::boxed::Box;
use core::hint::unreachable_unchecked;
use alloc::collections::{BTreeMap, BTreeSet,
LinkedList, VecDeque};
use alloc::rc::Rc;
use alloc::string::{String, ToString};
use alloc::sync::Arc;
use alloc::vec::Vec;
use crate::{DaemonicEmission, AXIOM_OFFSET};
use crate::const_daemonic_hash;
use crate::daemonic::TopologySegment;
use crate::Temporal;
use crate::Annotation;
use crate::Observation;
use crate::{DaemonicError};
use crate::daemonic::glass::daemonic::{DaemonicVariants, GlassError};
use crate::daemonic::glass::daemonic::glass::GlassContainers::GlassVec;
use crate::daemonic::glass::daemonic::GlassError::Containers;
use crate::daemonic::glass::daemonic_system_call::DaemonicSystemCall;
use crate::daemonic::glass::error::daemonic::glass::GlassContainers;
use crate::daemonic::TopologyAnchor;
use super::{Glass, Severity, ObservationTier, Error};
use super::states::{GlassStable, GlassCracked, GlassFractured, GlassUnknown, GlassShattered};
macro_rules! impl_glass_primitive {
($($anchor:ident, $upper:ident = $ty:ident),* $(,)?) => {
$(
pub const $anchor: TopologySegment = TopologySegment::new(concat!("Daemonic::Glass::Primitives::", stringify!($ty)));
#[allow(unsafe_code)]
unsafe impl DaemonicSystemCall for $ty {}
impl Glass<$ty> for $ty {
type Anchor = TopologySegment;
fn position(&self) -> &TopologySegment { &$anchor }
fn severity(&self) -> Severity { Severity::Stable }
fn tier(&self) -> ObservationTier { ObservationTier::Primitive }
fn payload(&self) -> Option<&$ty> { Some(&self) }
fn into_payload(self) -> Option<$ty> { Some(self) }
}
impl GlassStable<$ty> for $ty {
fn value(&self) -> ::daemonic_error::daemonic::observation::Stable<&$ty> {
::daemonic_error::daemonic::observation::Stable::new(&self, &$anchor)
}
fn into_value(self) -> ::daemonic_error::daemonic::observation::Stable<$ty> {
::daemonic_error::daemonic::observation::Stable::new(self, &$anchor)
}
}
)*
};
}
impl_glass_primitive!(
U8_TOPOLOGY_ANCHOR, U8 = u8,
U16_TOPOLOGY_ANCHOR, U16 = u16,
U32_TOPOLOGY_ANCHOR, U32 = u32,
U64_TOPOLOGY_ANCHOR, U64 = u64,
U128_TOPOLOGY_ANCHOR, U128 = u128,
USIZE_TOPOLOGY_ANCHOR, USIZE = usize,
I8_TOPOLOGY_ANCHOR, I8 = i8,
I16_TOPOLOGY_ANCHOR, I16 = i16,
I32_TOPOLOGY_ANCHOR, I32 = i32,
I64_TOPOLOGY_ANCHOR, I64 = i64,
I128_TOPOLOGY_ANCHOR, I128 = i128,
ISIZE_TOPOLOGY_ANCHOR, ISIZE = isize,
F32_TOPOLOGY_ANCHOR, F32 = f32,
F64_TOPOLOGY_ANCHOR, F64 = f64,
BOOL_TOPOLOGY_ANCHOR, BOOL = bool,
CHAR_TOPOLOGY_ANCHOR, CHAR = char,
);
static PARENTHETICAL_ENCLOSURE_TOPOLOGY_ANCH0R: TopologySegment = TopologySegment {
label: "Daemonic::Glass::Primitives::()",
hash: const_daemonic_hash(
"Daemonic::Glass::Primitives::()".as_bytes(),
AXIOM_OFFSET,
),
crypto_id: const_daemonic_hash("Daemonic::Glass::Primitives::()".as_bytes(), TOPOLOGY_ANCHOR),
depth: 3u16,
};
use crate::TOPOLOGY_ANCHOR;
#[allow(unsafe_code)]
unsafe impl DaemonicSystemCall for () {}
impl Glass<()> for () {
type Anchor = TopologySegment;
fn position(&self) -> &TopologySegment { &PARENTHETICAL_ENCLOSURE_TOPOLOGY_ANCH0R }
fn severity(&self) -> Severity { Severity::Stable }
fn tier(&self) -> ObservationTier { ObservationTier::Primitive }
fn payload(&self) -> Option<&()> { Some(self) }
fn into_payload(self) -> Option<()> { Some(self) }
}
impl GlassStable<()> for () {
fn value(&self) -> ::daemonic_error::daemonic::observation::Stable<&()> {
::daemonic_error::daemonic::observation::Stable::new(self, &PARENTHETICAL_ENCLOSURE_TOPOLOGY_ANCH0R)
}
fn into_value(self) -> ::daemonic_error::daemonic::observation::Stable<()> {
::daemonic_error::daemonic::observation::Stable::new(self, &PARENTHETICAL_ENCLOSURE_TOPOLOGY_ANCH0R)
}
}
static STR_TOPOLOGY_ANCH0R: TopologySegment = TopologySegment::new("Daemonic::Glass::Primitives::str");
#[allow(unsafe_code)]
unsafe impl DaemonicSystemCall for str {}
impl Glass<str> for str {
type Anchor = TopologySegment;
fn position(&self) -> &TopologySegment {
&STR_TOPOLOGY_ANCH0R
}
fn severity(&self) -> Severity {
Severity::Stable
}
fn payload(&self) -> Option<&str> {
Some(self)
}
fn into_payload(self) -> Option<str>
where
Self: Sized,
{
unreachable!()
}
}
impl GlassStable<str> for str
where
Self: Sized,
{
fn value(&self) -> crate::daemonic::observation::Stable<&str> {
crate::daemonic::observation::Stable::new(self, &STR_TOPOLOGY_ANCH0R).mutate_tier(ObservationTier::Primitive)
}
#[allow(dead_code)]
fn into_value(self) -> crate::daemonic::observation::Stable<str>
where
Self: Sized,
{
#[allow(unsafe_code)]
unsafe { unreachable_unchecked() }
}
}
macro_rules! impl_glass_containers {
($($anchor:ident, $upper:ident = $ty:ident),* $(,)?) => {
$(
pub(crate) static $anchor: TopologySegment = TopologySegment {
label: concat!("Daemonic::Glass::Containers::", stringify!($ty)),
hash: const_daemonic_hash(
concat!("Daemonic::Glass::Containers::", stringify!($ty)).as_bytes(),
AXIOM_OFFSET,
),
crypto_id: const_daemonic_hash(
concat!("Daemonic::Glass::Containers::", stringify!($ty)).as_bytes(),
TOPOLOGY_ANCHOR,
),
depth: 3u16,
};
#[allow(unsafe_code)]
unsafe impl DaemonicSystemCall for $ty {}
impl Glass<$ty> for $ty {
type Anchor = $ty;
fn position(&self) -> &TopologySegment { &$anchor }
fn severity(&self) -> Severity { Severity::Stable }
fn tier(&self) -> ObservationTier { ObservationTier::Primitive }
fn payload(&self) -> Option<&$ty> { Some(self) }
fn into_payload(self) -> Option<$ty> { Some(self) }
}
impl GlassStable<$ty> for $ty {
fn value(&self) -> crate::daemonic::observation::Stable<$ty> {
crate::daemonic::observation::Stable::new(&self, &$anchor).mutate_tier(ObservationTier::Composed)
}
fn into_value(self) -> crate::daemonic::observation::Stable<$ty> {
crate::daemonic::observation::Stable::new(self, &$anchor).mutate_tier(ObservationTier::Composed)
}
}
)*
};
}
static VEC_TOPOLOGY_ANCH0R: TopologySegment = TopologySegment::new("Daemonic::Glass::Containers::Vec<T>");
impl<GLASS> Glass<Vec<GLASS>> for Vec<GLASS>
where
GLASS: Glass<GLASS>,
Self: Send + Sync,
{
type Anchor = TopologySegment;
fn position(&self) -> &TopologySegment {
&VEC_TOPOLOGY_ANCH0R
}
fn severity(&self) -> Severity {
if self.is_empty() {
Severity::Unknown } else {
Severity::Stable }
}
fn payload(&self) -> Option<&Vec<GLASS>> {
Some(self)
}
fn into_payload(self) -> Option<Vec<GLASS>> {
Some(self)
}
}
impl<GLASS> GlassStable<Vec<GLASS>> for Vec<GLASS>
where
GLASS: Glass<GLASS>,
Self: Glass<Vec<GLASS>>,
{
fn value(&self) -> crate::daemonic::observation::Stable<&Vec<GLASS>> {
crate::daemonic::observation::Stable::new(self, &VEC_TOPOLOGY_ANCH0R).mutate_tier(ObservationTier::Primitive)
}
fn into_value(self) -> crate::daemonic::observation::Stable<Vec<GLASS>> {
crate::daemonic::observation::Stable::new(self, &VEC_TOPOLOGY_ANCH0R).mutate_tier(ObservationTier::Primitive)
}
}
impl<'error, T> DaemonicError<'error> for Vec<T>
where
Self: Glass<Vec<T>>,
T: Glass<T> + 'error,
{
fn emit(self) -> DaemonicEmission {
let error = Error::Daemonic(DaemonicVariants::Glass(Containers(GlassVec(crate::daemonic::glass::daemonic::glass::GlassVecError {
msg: "Im not sure how a Vec container could break, but this is the first hand written attempt so fuck it".to_string(),
}))));
let obs = ::daemonic_error::daemonic::observation::Stable::new(error, &VEC_TOPOLOGY_ANCH0R);
DaemonicEmission::new(obs)
}
fn position(&self) -> &TopologySegment {
&VEC_TOPOLOGY_ANCH0R
}
}
impl<T> GlassCracked<Vec<T>> for Vec<T>
where
T: Glass<T> + 'static, Self: Glass<Vec<T>>,
{
fn is_holding(&self) -> bool {
!self.is_empty()
}
}
static VECDEQUE_TOPOLOGY_ANCH0R: TopologySegment = TopologySegment {
label: "Daemonic::Glass::Containers::VecDeque<T>",
hash: const_daemonic_hash(
"Daemonic::Glass::Containers::VecDeque<T>".as_bytes(),
AXIOM_OFFSET,
),
crypto_id: const_daemonic_hash("Daemonic::Glass::Containers::VecDeque<T>".as_bytes(), TOPOLOGY_ANCHOR),
depth: 3u16,
};
impl<T> Glass<VecDeque<T>> for VecDeque<T>
where
T: Glass<T>,
{
type Anchor = TopologySegment;
fn position(&self) -> &TopologySegment {
&VECDEQUE_TOPOLOGY_ANCH0R
}
fn severity(&self) -> Severity {
if self.is_empty() {
Severity::Unknown } else {
Severity::Stable }
}
fn payload(&self) -> Option<&VecDeque<T>> {
Some(self)
}
fn into_payload(self) -> Option<VecDeque<T>> {
Some(self)
}
}
static VECDEQUE_TOPOLOGY_SEGMENT: TopologySegment = TopologySegment::new("Daemonic::Glass::Containers::VecDeque<T>");
impl<T> GlassStable<VecDeque<T>> for VecDeque<T>
where
T: Glass<T>,
Self: Glass<VecDeque<T>>,
{
fn value(&self) -> ::daemonic_error::daemonic::observation::Stable<&VecDeque<T>> {
::daemonic_error::daemonic::observation::Stable::new(self, &VECDEQUE_TOPOLOGY_SEGMENT)
}
fn into_value(self) -> ::daemonic_error::daemonic::observation::Stable<VecDeque<T>> {
::daemonic_error::daemonic::observation::Stable::new(self, &VECDEQUE_TOPOLOGY_SEGMENT)
}
}
impl<'error, T> DaemonicError<'error> for VecDeque<T>
where
Self: Glass<VecDeque<T>>,
T: Glass<T> + 'error,
{
fn emit(self) -> DaemonicEmission {
todo!()
}
fn position(&self) -> &TopologySegment {
&VECDEQUE_TOPOLOGY_ANCH0R
}
}
impl<GLASS> GlassCracked<VecDeque<GLASS>> for VecDeque<GLASS>
where
GLASS: Glass<GLASS> + 'static,
Self: Glass<VecDeque<GLASS>>,
{
fn is_holding(&self) -> bool {
!self.is_empty()
}
fn repair(&self) -> Option<&dyn Fn() -> VecDeque<GLASS>> {
None }
}
impl<GLASS> Glass<LinkedList<GLASS>> for LinkedList<GLASS>
where
GLASS: Glass<GLASS>,
Self: Send + Sync,
{
type Anchor = TopologySegment;
fn position(&self) -> &TopologySegment {
&VECDEQUE_TOPOLOGY_ANCH0R
}
fn severity(&self) -> Severity {
if self.is_empty() {
Severity::Unknown } else {
Severity::Stable }
}
fn payload(&self) -> Option<&LinkedList<GLASS>> {
Some(&self)
}
fn into_payload(self) -> Option<LinkedList<GLASS>> {
Some(self)
}
}
static LINKED_LIST_TOPOLOGY_ANCH0R: TopologySegment = TopologySegment::new("Daemonic::Glass::Containers::LinkedList<GLASS>");
impl<GLASS> GlassStable<LinkedList<GLASS>> for LinkedList<GLASS>
where
GLASS: Glass<GLASS>,
Self: Glass<LinkedList<GLASS>>,
{
fn value(&self) -> ::daemonic_error::daemonic::observation::Stable<&LinkedList<GLASS>> {
::daemonic_error::daemonic::observation::Stable::new(self, &LINKED_LIST_TOPOLOGY_ANCH0R)
}
fn into_value(self) -> ::daemonic_error::daemonic::observation::Stable<LinkedList<GLASS>> {
::daemonic_error::daemonic::observation::Stable::new(self, &LINKED_LIST_TOPOLOGY_ANCH0R)
}
}
impl<'error, GLASS> DaemonicError<'error> for LinkedList<GLASS>
where
GLASS: Glass<GLASS> + 'static,
Self: Glass<LinkedList<GLASS>>,
{
fn emit(self) -> DaemonicEmission {
todo!()
}
fn position(&self) -> &TopologySegment {
&LINKED_LIST_TOPOLOGY_ANCH0R
}
}
impl<GLASS> GlassCracked<LinkedList<GLASS>> for LinkedList<GLASS>
where
GLASS: Glass<GLASS> + 'static,
Self: Glass<LinkedList<GLASS>>,
{
fn is_holding(&self) -> bool {
!self.is_empty()
}
fn repair(&self) -> Option<&dyn Fn() -> LinkedList<GLASS>> {
None }
}
static BTREE_MAP_LIST_TOPOLOGY_ANCH0R: TopologySegment = TopologySegment {
label: "Daemonic::Glass::Containers::BTreeMap<K, V>",
hash: const_daemonic_hash(
"Daemonic::Glass::Containers::BTreeMap<K, V>".as_bytes(),
AXIOM_OFFSET,
),
crypto_id: const_daemonic_hash("Daemonic::Glass::Containers::BTreeMap<K, V>".as_bytes(), TOPOLOGY_ANCHOR),
depth: 3u16,
};
impl<K, V> Glass<BTreeMap<K, V>> for BTreeMap<K, V>
where
K: Glass<K>,
V: Glass<V>,
Self: Send + Sync,
{
type Anchor = TopologySegment;
fn position(&self) -> &TopologySegment {
&BTREE_MAP_LIST_TOPOLOGY_ANCH0R
}
fn severity(&self) -> Severity {
if self.is_empty() {
Severity::Unknown } else {
Severity::Stable }
}
fn payload(&self) -> Option<&BTreeMap<K, V>> {
Some(self)
}
fn into_payload(self) -> Option<BTreeMap<K, V>> {
Some(self)
}
}
impl<K, V> GlassStable<BTreeMap<K, V>> for BTreeMap<K, V>
where
K: Glass<K>,
V: Glass<V>,
Self: Glass<BTreeMap<K, V>>,
{
fn value(&self) -> ::daemonic_error::daemonic::observation::Stable<&BTreeMap<K, V>> {
::daemonic_error::daemonic::observation::Stable::new(&self, &BTREE_MAP_LIST_TOPOLOGY_ANCH0R)
}
fn into_value(self) -> ::daemonic_error::daemonic::observation::Stable<BTreeMap<K, V>> {
::daemonic_error::daemonic::observation::Stable::new(self, &BTREE_MAP_LIST_TOPOLOGY_ANCH0R)
}
}
impl<'error, K, V> DaemonicError<'error> for BTreeMap<K, V>
where
K: Glass<K> + 'static,
V: Glass<V> + 'static,
Self: Glass<BTreeMap<K, V>>,
{
fn emit(self) -> DaemonicEmission {
todo!()
}
fn position(&self) -> &TopologySegment {
&BTREE_MAP_LIST_TOPOLOGY_ANCH0R
}
}
impl<K, V> GlassCracked<BTreeMap<K, V>> for BTreeMap<K, V>
where
K: Glass<K> + 'static,
V: Glass<V> + 'static,
Self: Glass<BTreeMap<K, V>>,
{
fn is_holding(&self) -> bool {
!self.is_empty()
}
fn repair(&self) -> Option<&dyn Fn() -> BTreeMap<K, V>> {
None }
}
static BTREE_SET_TOPOLOGY_ANCH0R: TopologySegment = TopologySegment {
label: "Daemonic::Glass::Containers::BTreeSet<T>",
hash: const_daemonic_hash(
"Daemonic::Glass::Containers::BTreeSet<T>".as_bytes(),
AXIOM_OFFSET,
),
crypto_id: const_daemonic_hash("Daemonic::Glass::Containers::BTreeSet<T>".as_bytes(), TOPOLOGY_ANCHOR),
depth: 3u16,
};
impl<T> Glass<BTreeSet<T>> for BTreeSet<T>
where
T: Glass<T> + 'static,
Self: Send + Sync,
{
type Anchor = TopologySegment;
fn position(&self) -> &TopologySegment {
&BTREE_SET_TOPOLOGY_ANCH0R
}
fn severity(&self) -> Severity {
if self.is_empty() {
Severity::Unknown } else {
Severity::Stable }
}
fn payload(&self) -> Option<&BTreeSet<T>> {
Some(self)
}
fn into_payload(self) -> Option<BTreeSet<T>> {
Some(self)
}
}
impl<T> GlassStable<BTreeSet<T>> for BTreeSet<T>
where
T: Glass<T>,
Self: Glass<BTreeSet<T>>,
{
fn value(&self) -> ::daemonic_error::daemonic::observation::Stable<&BTreeSet<T>> {
::daemonic_error::daemonic::observation::Stable::new(&self, &BTREE_SET_TOPOLOGY_ANCH0R)
}
fn into_value(self) -> ::daemonic_error::daemonic::observation::Stable<BTreeSet<T>> {
::daemonic_error::daemonic::observation::Stable::new(self, &BTREE_SET_TOPOLOGY_ANCH0R)
}
}
impl<'error, T> DaemonicError<'error> for BTreeSet<T>
where
Self: Glass<BTreeSet<T>>,
T: Glass<T> + 'error,
{
fn emit(self) -> DaemonicEmission {
todo!()
}
fn position(&self) -> &TopologySegment {
&BTREE_SET_TOPOLOGY_ANCH0R
}
}
impl<T> GlassCracked<BTreeSet<T>> for BTreeSet<T>
where
T: Glass<T> + 'static,
Self: Glass<BTreeSet<T>>,
{
fn is_holding(&self) -> bool {
!self.is_empty()
}
fn repair(&self) -> Option<&dyn Fn() -> BTreeSet<T>> {
None }
}
static GENERIC_ARRAY_TOPOLOGY_ANCH0R: TopologySegment = TopologySegment::new("Daemonic::Glass::Containers::[T; N]");
impl<T, const N: usize> Glass<[T; N]> for [T; N]
where
T: Glass<T>,
Self: Send + Sync,
{
type Anchor = TopologySegment;
fn position(&self) -> &TopologySegment {
&GENERIC_ARRAY_TOPOLOGY_ANCH0R
}
fn severity(&self) -> Severity {
if N == 0 {
Severity::Unknown } else {
Severity::Stable
}
}
fn payload(&self) -> Option<&[T; N]> {
Some(self)
}
fn into_payload(self) -> Option<[T; N]> {
Some(self)
}
}
impl<T, const N: usize> GlassStable<[T; N]> for [T; N]
where
T: Glass<T>,
Self: Glass<[T; N]>,
{
fn value(&self) -> ::daemonic_error::daemonic::observation::Stable<&[T; N]> {
::daemonic_error::daemonic::observation::Stable::new(&self, &GENERIC_ARRAY_TOPOLOGY_ANCH0R)
}
fn into_value(self) -> ::daemonic_error::daemonic::observation::Stable<[T; N]> {
::daemonic_error::daemonic::observation::Stable::new(self, &GENERIC_ARRAY_TOPOLOGY_ANCH0R)
}
}
impl<'error, T, const N: usize> DaemonicError<'error> for [T; N]
where
Self: Glass<[T; N]>,
T: Glass<T> + 'error,
{
fn emit(self) -> DaemonicEmission {
todo!()
}
fn position(&self) -> &TopologySegment {
&GENERIC_ARRAY_TOPOLOGY_ANCH0R
}
}
impl<T, const N: usize> GlassCracked<[T; N]> for [T; N]
where
T: Glass<T> + 'static,
Self: Glass<[T; N]>,
{
fn is_holding(&self) -> bool {
N > 0
}
fn repair(&self) -> Option<&dyn Fn() -> [T; N]> {
None }
}
static GENERIC_ARRAY2_TOPOLOGY_ANCH0R: TopologySegment = TopologySegment {
label: "Daemonic::Glass::Containers::[T]",
hash: const_daemonic_hash(
"Daemonic::Glass::Containers::[T]".as_bytes(),
AXIOM_OFFSET,
),
crypto_id: const_daemonic_hash("Daemonic::Glass::Containers::[T]".as_bytes(), TOPOLOGY_ANCHOR),
depth: 3u16,
};
impl<T> Glass<[T]> for [T]
where
T: Glass<T>,
{
type Anchor = TopologySegment;
fn position(&self) -> &TopologySegment {
&GENERIC_ARRAY2_TOPOLOGY_ANCH0R
}
fn severity(&self) -> Severity {
if self.is_empty() {
Severity::Unknown } else {
Severity::Stable }
}
fn payload(&self) -> Option<&[T]> {
Some(self)
}
fn into_payload(self) -> Option<[T]>
where
Self: Sized,
{
Some(self)
}
}
impl<T> GlassStable<[T]> for [T]
where
Self: Sized,
T: Glass<T>,
{
fn value(&self) -> ::daemonic_error::daemonic::observation::Stable<&[T]> {
::daemonic_error::daemonic::observation::Stable::new(&self, &GENERIC_ARRAY2_TOPOLOGY_ANCH0R)
}
fn into_value(self) -> ::daemonic_error::daemonic::observation::Stable<[T]>
where
Self: Sized,
{
::daemonic_error::daemonic::observation::Stable::new(self, &GENERIC_ARRAY2_TOPOLOGY_ANCH0R)
}
}
impl<'error, T: 'error> DaemonicError<'error> for [T]
where
Self: Sized,
{
fn emit(self) -> DaemonicEmission {
todo!()
}
fn position(&self) -> &TopologySegment {
&GENERIC_ARRAY2_TOPOLOGY_ANCH0R
}
}
impl<T> GlassCracked<[T]> for [T]
where
T: Glass<T> + 'static,
Self: Sized,
{
fn is_holding(&self) -> bool {
!self.is_empty()
}
fn repair(&self) -> Option<&dyn Fn() -> [T]> {
None }
}
static BOX_POINTER_TOPOLOGY_ANCH0R: TopologySegment = TopologySegment {
label: "Daemonic::Glass::Containers::Box<T>",
hash: const_daemonic_hash(
"Daemonic::Glass::Containers::Box<T>".as_bytes(),
AXIOM_OFFSET,
),
crypto_id: const_daemonic_hash("Daemonic::Glass::Containers::Box<T>".as_bytes(), TOPOLOGY_ANCHOR),
depth: 3u16,
};
impl<T> Glass<Box<T>> for Box<T>
where
T: Glass<T> + 'static,
Self: Send + Sync,
{
type Anchor = TopologySegment;
fn position(&self) -> &TopologySegment {
&BOX_POINTER_TOPOLOGY_ANCH0R
}
fn severity(&self) -> Severity {
(**self).severity()
}
fn payload(&self) -> Option<&Box<T>> {
Some(self)
}
fn into_payload(self) -> Option<Box<T>> {
Some(self)
}
}
impl<T> GlassStable<Box<T>> for Box<T>
where
T: Glass<T> + 'static,
Self: Send + Sync,
{
fn value(&self) -> ::daemonic_error::daemonic::observation::Stable<&Box<T>> {
::daemonic_error::daemonic::observation::Stable::new(&self, &BOX_POINTER_TOPOLOGY_ANCH0R)
}
fn into_value(self) -> ::daemonic_error::daemonic::observation::Stable<Box<T>> {
::daemonic_error::daemonic::observation::Stable::new(self, &BOX_POINTER_TOPOLOGY_ANCH0R)
}
}
static RC_POINTER_TOPOLOGY_ANCH0R: TopologySegment = TopologySegment {
label: "Daemonic::Glass::Containers::Rc<T>",
hash: const_daemonic_hash(
"Daemonic::Glass::Containers::Rc<T>".as_bytes(),
AXIOM_OFFSET,
),
crypto_id: const_daemonic_hash("Daemonic::Glass::Containers::Rc<T>".as_bytes(), TOPOLOGY_ANCHOR),
depth: 3u16,
};
impl<T> Glass<T> for Rc<T>
where
T: Glass<T>,
{
type Anchor = TopologySegment;
fn position(&self) -> &TopologySegment {
&RC_POINTER_TOPOLOGY_ANCH0R
}
fn severity(&self) -> Severity {
(**self).severity()
}
fn payload(&self) -> Option<&T> {
let x = self;
Some(x)
}
fn into_payload(self) -> Option<T> {
todo!("I DONT KNOW WHY THIS WONT WORK BUT IT WONT WORK SO FUCK YOU\
ILL FIX YOUR SHIT LATER\
Dated: 2026-09-21\
Time Spent: 5 days combined\
Comment: THIS SHIT IS ALSO FUCKING MEANINGLESS")
}
}
impl<T> Glass<Rc<T>> for Rc<T>
where
T: Glass<T>,
{
type Anchor = TopologySegment;
fn position(&self) -> &TopologySegment {
&RC_POINTER_TOPOLOGY_ANCH0R
}
fn severity(&self) -> Severity {
Severity::Unknown
}
fn payload(&self) -> Option<&Rc<T>> {
let x = self;
Some(x)
}
fn into_payload(self) -> Option<Rc<T>>
where
Self: Sized,
Rc<T>: Sized,
{
let x = self;
Some(x)
}
}
impl<T> GlassStable<Rc<T>> for Rc<T>
where
T: Glass<T>,
{
fn value(&self) -> ::daemonic_error::daemonic::observation::Stable<&Rc<T>> {
::daemonic_error::daemonic::observation::Stable::new(&self, &RC_POINTER_TOPOLOGY_ANCH0R)
}
fn into_value(self) -> ::daemonic_error::daemonic::observation::Stable<Rc<T>> {
::daemonic_error::daemonic::observation::Stable::new(self, &RC_POINTER_TOPOLOGY_ANCH0R)
}
}
static ARC_POINTER_TOPOLOGY_ANCH0R: TopologySegment = TopologySegment {
label: "Daemonic::Glass::Containers::Arc<T>",
hash: const_daemonic_hash(
"Daemonic::Glass::Containers::Arc<T>".as_bytes(),
AXIOM_OFFSET,
),
crypto_id: const_daemonic_hash("Daemonic::Glass::Containers::Arc<T>".as_bytes(), TOPOLOGY_ANCHOR),
depth: 3u16,
};
impl<T> Glass<Arc<T>> for Arc<T>
where
T: Glass<T>,
{
type Anchor = TopologySegment;
fn position(&self) -> &TopologySegment {
&ARC_POINTER_TOPOLOGY_ANCH0R
}
fn severity(&self) -> Severity {
(**self).severity()
}
fn payload(&self) -> Option<&Arc<T>> {
Some(self)
}
fn into_payload(self) -> Option<Arc<T>> {
Some(self)
}
}
impl<T> GlassStable<Arc<T>> for Arc<T>
where
T: Glass<T>,
{
fn value(&self) -> ::daemonic_error::daemonic::observation::Stable<&Arc<T>> {
::daemonic_error::daemonic::observation::Stable::new(&self, &ARC_POINTER_TOPOLOGY_ANCH0R)
}
fn into_value(self) -> ::daemonic_error::daemonic::observation::Stable<Arc<T>> {
::daemonic_error::daemonic::observation::Stable::new(self, &ARC_POINTER_TOPOLOGY_ANCH0R)
}
}
static GENERIC_REFERENCE_POINTER_TOPOLOGY_ANCH0R: TopologySegment = TopologySegment {
label: "Daemonic::Glass::Containers::&T",
hash: const_daemonic_hash(
"Daemonic::Glass::Containers::&T".as_bytes(),
AXIOM_OFFSET,
),
crypto_id: const_daemonic_hash("Daemonic::Glass::Containers::&T".as_bytes(), TOPOLOGY_ANCHOR),
depth: 3u16,
};
impl<T> Glass<Option<T>> for Option<T>
where
T: Glass<T>,
Self: Send + Sync,
{
type Anchor = TopologySegment;
fn position(&self) -> &TopologySegment {
&OPTION_TOPOLOGY_ANCH0R
}
fn severity(&self) -> Severity {
match self {
Some(_) => Severity::Stable,
None => Severity::Unknown, }
}
fn payload(&self) -> Option<&Option<T>> {
Some(self)
}
fn into_payload(self) -> Option<Option<T>> {
Some(self)
}
}
static OPTION_TOPOLOGY_ANCH0R: TopologySegment = TopologySegment {
label: "Daemonic::Glass::Containers::Option<T>",
hash: const_daemonic_hash(
"Daemonic::Glass::Containers::Option<T>".as_bytes(),
AXIOM_OFFSET,
),
crypto_id: const_daemonic_hash("Daemonic::Glass::Containers::Option<T>".as_bytes(), TOPOLOGY_ANCHOR),
depth: 3u16,
};
impl<T> GlassStable<Option<T>> for Option<T>
where
T: Glass<T>,
Self: Glass<Option<T>>,
{
fn value(&self) -> ::daemonic_error::daemonic::observation::Stable<&Option<T>> {
::daemonic_error::daemonic::observation::Stable::new(&self, &OPTION_TOPOLOGY_ANCH0R)
}
fn into_value(self) -> ::daemonic_error::daemonic::observation::Stable<Option<T>> {
::daemonic_error::daemonic::observation::Stable::new(self, &OPTION_TOPOLOGY_ANCH0R)
}
}
impl<'error, T> DaemonicError<'error> for Option<T>
where
Self: Glass<Option<T>>,
T: Glass<T> + 'error,
{
fn position(&self) -> &TopologySegment {
&OPTION_TOPOLOGY_ANCH0R
}
fn emit(self) -> DaemonicEmission {
todo!()
}
}
impl<T> GlassCracked<Option<T>> for Option<T>
where
T: Glass<T> + 'static,
Self: Glass<Option<T>>,
{
fn is_holding(&self) -> bool {
self.is_some()
}
fn repair(&self) -> Option<&dyn Fn() -> Option<T>> {
None }
}
static RESULT_TOPOLOGY_ANCH0R: TopologySegment = TopologySegment {
label: "Daemonic::Glass::Containers::Result<T, E>",
hash: const_daemonic_hash(
"Daemonic::Glass::Containers::Result<T, E>".as_bytes(),
AXIOM_OFFSET,
),
crypto_id: const_daemonic_hash("Daemonic::Glass::Containers::Result<T, E>".as_bytes(), TOPOLOGY_ANCHOR),
depth: 3u16,
};
impl<T, E> Glass<Result<T, E>> for Result<T, E>
where
T: Glass<T>,
E: Glass<E>,
Self: Send + Sync,
{
type Anchor = TopologySegment;
fn position(&self) -> &TopologySegment {
&RESULT_TOPOLOGY_ANCH0R
}
fn severity(&self) -> Severity {
match self {
Ok(_) => Severity::Stable,
Err(_) => Severity::Shattered, }
}
fn payload(&self) -> Option<&Result<T, E>> {
Some(self)
}
fn into_payload(self) -> Option<Result<T, E>> {
Some(self)
}
}