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
use RangeInclusive;
use crate::;
/// Trait automatically derived on structs, by the `BitString` macro.
/// Used for checking if binary data fits into defined struct.
///
/// ```
/// /// Bit length of 2
/// struct MyBitString {
/// flag1: bool,
/// flag2: bool,
/// }
/// ```
///
/// ```rust,ignore
/// use der::BitString;
///
/// /// Bit length of 3..=4
/// #[derive(BitString)]
/// struct MyBitString {
/// flag1: bool,
/// flag2: bool,
/// flag3: bool,
///
/// #[asn1(optional = "true")]
/// flag4: bool,
/// }
/// ```