1use core::{convert::Infallible, ops::Add};
2
3pub use crate::{Gt, Zero};
4
5#[sealed::sealed]
6pub trait SizedKind {}
7
8#[sealed::sealed]
9pub trait MetadataKind {}
10
11pub struct Sized<K: SizedKind>(core::marker::PhantomData<K>, Infallible);
15
16pub struct MetaSized<K: MetadataKind>(core::marker::PhantomData<K>, Infallible);
22
23pub enum SliceLike {}
27
28pub enum DynTraitLike {}
30
31pub enum ExternTypeLike {}
35
36#[sealed::sealed]
37impl SizedKind for Zero {}
38
39#[sealed::sealed]
40impl SizedKind for crate::Gt<crate::Zero> {}
41
42#[sealed::sealed]
43impl MetadataKind for SliceLike {}
44
45#[sealed::sealed]
46impl MetadataKind for DynTraitLike {}
47
48pub(crate) trait Thin {}
52impl<K: SizedKind> Thin for Sized<K> {}
53impl Thin for ExternTypeLike {}
54
55pub(crate) trait Dst {}
56impl Dst for ExternTypeLike {}
57impl<K: MetadataKind> Dst for MetaSized<K> {}
58
59impl<K: SizedKind> Add<Sized<K>> for Sized<Zero> {
60 type Output = Sized<K>;
61
62 fn add(self, _: Sized<K>) -> Self::Output {
63 unreachable!()
64 }
65}
66
67impl<K: SizedKind> Add<Sized<K>> for Sized<crate::Gt<crate::Zero>> {
68 type Output = Self;
69
70 fn add(self, _: Sized<K>) -> Self::Output {
71 unreachable!()
72 }
73}
74
75impl<K: Dst, U: SizedKind> Add<K> for Sized<U> {
76 type Output = K;
77
78 fn add(self, _: K) -> Self::Output {
79 unreachable!()
80 }
81}
82
83impl<K: MetadataKind, U: SizedKind> Add<Sized<U>> for MetaSized<K> {
84 type Output = Self;
85
86 fn add(self, _: Sized<U>) -> Self::Output {
87 unreachable!()
88 }
89}
90
91impl<U: SizedKind> Add<Sized<U>> for ExternTypeLike {
92 type Output = Self;
93
94 fn add(self, _: Sized<U>) -> Self::Output {
95 unreachable!()
96 }
97}