1#![no_std]
7
8#![doc = include_str!("README.md")]
10
11#![allow(incomplete_features)]
13
14#![feature(const_trait_impl)]
16#![feature(const_convert)]
17#![feature(unsized_const_params)]
18#![feature(adt_const_params)]
19#![feature(negative_impls)]
20#![feature(const_heap)]
21#![feature(const_default)]
22#![feature(generic_const_exprs)]
23
24extern crate alloc;
26
27mod root;
29
30pub use root::Root;
32
33use alloc::vec::Vec;
35
36use core::{
38 ptr::NonNull,
39 ops::Deref
40};
41
42
43pub struct Report<const NAME: &'static str> {
49 chain: NonNull<Vec<&'static str>>,
50}
51
52impl<const NAME: &'static str> Report<NAME> {
54 pub const fn to<const OTHER: &'static str>(&mut self) -> Report<OTHER> {
55 if !OTHER.is_empty() {unsafe {self.chain.as_mut().push(OTHER)};}
56 return Report {
57 chain: self.chain
58 }
59 }
60}
61
62impl<const NAME: &'static str> Drop for Report<NAME> {
64 fn drop(&mut self) {if !NAME.is_empty() {unsafe {self.chain.as_mut().pop()};}}
65}
66
67impl<const NAME: &'static str> !Send for Report<NAME> {}
69
70impl<const NAME: &'static str> !Sync for Report<NAME> {}
72
73impl<const NAME: &'static str> Deref for Report<NAME> {
75 type Target = [&'static str];
76 fn deref(&self) -> &Self::Target {return unsafe {&self.chain.as_ref()}}
77}