File: slice.md

package info (click to toggle)
rust-coreutils 0.7.0-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 505,620 kB
  • sloc: ansic: 103,594; asm: 28,570; sh: 8,910; python: 5,581; makefile: 472; cpp: 97; javascript: 72
file content (14 lines) | stat: -rw-r--r-- 622 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
# Bit-Slice De/Serialization

Bit-slice references and containers serialize as sequences with additional
metadata.

Serde only provides a deserializer for `&[u8]`; wider integers and
interior-mutability wrappers are not able to view a transport buffer without
potentially modifying it, and the buffer is not modifiable while being used for
deserialization. As such, only `&BitSlice<u8, O>` has a no-copy deserialization
implementation.

If you need other storage types, you will need to deserialize into a `BitBox` or
`BitVec`. If you do not have an allocator, you must *serialize from* and
deserialize into a `BitArray`.