1mod arr_impls;
2mod int_impls;
3
4pub trait Bitfield {
6 type Storage;
8}
9
10#[cfg(feature = "gce")]
11const_trait! {
12 #[cfg_attr(all(doc, feature = "nightly"), doc(cfg(feature = "gce")))]
14 pub trait NestableBitfield<S, const START: usize, const END: usize> {
15 type Nested<'a>: const crate::__private::NestedBitfield<'a, S>
16 where
17 S: 'a;
18 }
19}
20
21#[cfg(feature = "gce")]
22const_trait! {
23 #[cfg_attr(all(doc, feature = "nightly"), doc(cfg(feature = "gce")))]
25 pub trait NestableMutBitfield<S, const START: usize, const END: usize> {
26 type NestedMut<'a>: const crate::__private::NestedMutBitfield<'a, S>
27 where
28 S: 'a;
29 }
30}
31
32#[cfg(feature = "gce")]
33const_trait! {
34 #[cfg_attr(all(doc, feature = "nightly"), doc(cfg(feature = "gce")))]
36 pub trait NestableWriteBitfield<S, const START: usize, const END: usize> {
37 type NestedWrite<'a>: const crate::__private::NestedWriteBitfield<'a, S>
38 where
39 S: 'a;
40 }
41}
42
43const_trait! {
44 pub trait Bits<T> {
46 fn bits<const START: usize, const END: usize>(&self) -> T;
48 }
49}
50
51const_trait! {
52 pub trait WithBits<T> {
54 #[must_use]
55 fn with_bits<const START: usize, const END: usize>(self, value: T) -> Self;
58 }
59}
60
61const_trait! {
62 pub trait SetBits<T> {
64 fn set_bits<const START: usize, const END: usize>(&mut self, value: T);
67 }
68}
69
70const_trait! {
71 pub trait Bit {
73 fn bit<const BIT: usize>(&self) -> bool;
75 }
76}
77
78const_trait! {
79 pub trait WithBit {
81 #[must_use]
84 fn with_bit<const BIT: usize>(self, value: bool) -> Self;
85 }
86}
87
88const_trait! {
89 pub trait SetBit {
91 fn set_bit<const BIT: usize>(&mut self, value: bool);
93 }
94}