1#![doc = include_str!("README.md")]
7
8#![allow(incomplete_features)]
10
11#![feature(const_trait_impl)]
13#![feature(unsized_const_params)]
14#![feature(adt_const_params)]
15#![feature(negative_impls)]
16#![feature(const_heap)]
17#![feature(const_default)]
18#![feature(generic_const_exprs)]
19
20mod root;
22
23pub use root::Root;
25
26
27pub struct Report<'valid, const NAME: &'static str> {
33 chain: &'valid mut Vec<&'static str>
34}
35
36impl<'valid, const NAME: &'static str> Report<'valid, NAME> {
38 pub const fn chain(&'valid self) -> &'valid [&'static str] {return self.chain.as_slice()}
39 pub const fn to<const OTHER: &'static str>(&'valid mut self) -> Report<'valid, OTHER> {
40 if !OTHER.is_empty() {self.chain.push(OTHER);}
41 return Report {
42 chain: self.chain
43 }
44 }
45}
46
47impl<'valid, const NAME: &'static str> Drop for Report<'valid, NAME> {
49 fn drop(&mut self) {if !NAME.is_empty() {self.chain.pop();}}
50}
51
52impl<'valid, const NAME: &'static str> !Send for Report<'valid, NAME> {}
54
55impl<'valid, const NAME: &'static str> !Sync for Report<'valid, NAME> {}