File: boxed.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 (15 lines) | stat: -rw-r--r-- 687 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
# Heap-Allocated, Fixed-Size, Bit Buffer

This module defines an analogue to `Box<[bool]>`, as `Box<BitSlice>` cannot be
constructed or used in any way. Like `Box<[T]>`, this is a heap allocation that
can modify its contents, but cannot resize the collection. The `BitBox` value is
an owning [`*BitSlice`] pointer, and can be used to access its contents without
any decoding.

You should generally prefer [`BitVec`] or [`BitArray`]; however, very large
`BitArrays` are likely better served being copied into a `BitBox` rather than
being boxed themselves when moved into the heap.

[`BitArray`]: crate::array::BitArray
[`BitVec`]: crate::vec::BitVec
[`*BitSlice`]: crate::slice::BitSlice