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
extern crate self as bitrepr;
pub use ;
/// Types which can be represented as bits use this trait to specify the type of the underlying bit representation.
///
/// For example, a `f32` would use `u32` as its bit representation, because `f34` needs *at least* 32 bits to properly
/// represent its value.
///
/// Although any type may be accepted, only unsigned integer types are useful as representation types.
/// Types which are representable as bits may use this trait to convert into or from their bit representation.
/// For more information, look at the crate root documentation.
///
/// This trait is generally not intended to be manually implemented, and most of the time the derive macro `#[derive(BitPack)]`
/// should be used. To see examples of using the macro look at the crate documentation.
/// Types which are representable as bits may use this trait to convert into or from their bit representation.
/// This trait is different from [`BitPack`] in that the conversion from the bit representation may fail.
/// For more information, look at the crate root documentation.
///
/// This trait is generally not intended to be manually implemented, and most of the time the derive macro `#[derive(TryBitPack)]`
/// should be used. To see examples of using the macro look at the crate documentation.
/// Types which are representable as bits may use this trait to convert into or from their bit representation.
/// This trait is different from [`BitPack`] in that the conversion is unsafe and may cause undefined behaviour.
/// For more information, look at the crate root documentation.
///
/// This trait is generally not intended to be manually implemented, and most of the time the derive macro `#[derive(UnsafeBitPack)]`
/// should be used. To see examples of using the macro look at the crate documentation.