dungeon_cell/marker_traits/
size.rs1use core::mem::MaybeUninit;
2use core::panic::{RefUnwindSafe, UnwindSafe};
3
4use super::sealed::Sealed;
5use crate::layout::Size;
6
7pub trait IsSize:
12 Sealed
13 + Sized
14 + Copy
15 + Clone
16 + Sync
17 + Send
18 + Unpin
19 + RefUnwindSafe
20 + UnwindSafe
21 + 'static
22{
23 type Buffer: Send
27 + Sync
28 + Unpin
29 + Clone
30 + Copy
31 + RefUnwindSafe
32 + UnwindSafe
33 + 'static;
34
35 const UNINIT_BUFFER: Self::Buffer;
37
38 const VALUE: usize;
40}
41
42impl<const N: usize> Sealed for Size<N> {}
43
44impl<const N: usize> IsSize for Size<N> {
45 type Buffer = [MaybeUninit<u8>; N];
46
47 const UNINIT_BUFFER: Self::Buffer = [MaybeUninit::<u8>::uninit(); N];
48
49 const VALUE: usize = N;
50}