1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
use crate::string::RetrieveString;
use core::fmt::{self, Debug};
use core::mem;
use core::slice;
use core::str;
impl<const V: char> Debug for crate::MustBeChar<V> {
fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
write!(formatter, "MustBe!({:?})", V)
}
}
impl<const V: u128> Debug for crate::MustBePosInt<V> {
fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
write!(formatter, "MustBe!({})", V)
}
}
impl<const V: i128> Debug for crate::MustBeNegInt<V> {
fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
write!(formatter, "MustBe!({})", V)
}
}
impl<const V: u8> Debug for crate::MustBeU8<V> {
fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
write!(formatter, "MustBe!({}u8)", V)
}
}
impl<const V: u16> Debug for crate::MustBeU16<V> {
fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
write!(formatter, "MustBe!({}u16)", V)
}
}
impl<const V: u32> Debug for crate::MustBeU32<V> {
fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
write!(formatter, "MustBe!({}u32)", V)
}
}
impl<const V: u64> Debug for crate::MustBeU64<V> {
fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
write!(formatter, "MustBe!({}u64)", V)
}
}
impl<const V: u128> Debug for crate::MustBeU128<V> {
fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
write!(formatter, "MustBe!({}u128)", V)
}
}
impl<const V: i8> Debug for crate::MustBeI8<V> {
fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
write!(formatter, "MustBe!({}i8)", V)
}
}
impl<const V: i16> Debug for crate::MustBeI16<V> {
fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
write!(formatter, "MustBe!({}i16)", V)
}
}
impl<const V: i32> Debug for crate::MustBeI32<V> {
fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
write!(formatter, "MustBe!({}i32)", V)
}
}
impl<const V: i64> Debug for crate::MustBeI64<V> {
fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
write!(formatter, "MustBe!({}i64)", V)
}
}
impl<const V: i128> Debug for crate::MustBeI128<V> {
fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
write!(formatter, "MustBe!({}i128)", V)
}
}
impl<const V: bool> Debug for crate::MustBeBool<V> {
fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
write!(formatter, "MustBe!({})", V)
}
}
impl<V: RetrieveString> Debug for crate::MustBeStr<V> {
fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
write!(formatter, "MustBe!({:?})", unsafe {
str::from_utf8_unchecked(slice::from_raw_parts(
&V::BYTES as *const V::Type as *const u8,
mem::size_of::<V::Type>(),
))
})
}
}