| 1 |
# Bit-Slice De/Serialization |
| 2 |
|
| 3 |
Bit-slice references and containers serialize as sequences with additional |
| 4 |
metadata. |
| 5 |
|
| 6 |
Serde only provides a deserializer for `&[u8]`; wider integers and |
| 7 |
interior-mutability wrappers are not able to view a transport buffer without |
| 8 |
potentially modifying it, and the buffer is not modifiable while being used for |
| 9 |
deserialization. As such, only `&BitSlice<u8, O>` has a no-copy deserialization |
| 10 |
implementation. |
| 11 |
|
| 12 |
If you need other storage types, you will need to deserialize into a `BitBox` or |
| 13 |
`BitVec`. If you do not have an allocator, you must *serialize from* and |
| 14 |
deserialize into a `BitArray`. |