Skip to main content

Module bitmask_view

Module bitmask_view 

Source
Expand description

§BitmaskV Module - Windowed View over an Bitmask

BitmaskV is a logical, zero-copy, read-only window into a contiguous region of a Bitmask.

§Purpose

  • Indexable and bounds-checked access to a subset of a bit-packed mask.
  • All logical indices are relative to the window.
  • Avoids copying - shares the parent mask buffer via Arc.

§Behaviour

  • All operations remap indices internally to the correct positions in the parent mask.
  • Window slicing (slice) is O(1) - pointer and metadata updates only.
  • Arc Clones cheaply.
  • Use to_bitmask for a materialised copy of the view.

§Threading

  • Thread-safe by virtue of immutability - no interior mutability.

§Performance Notes

  • Before introducing a BitmaskV, consider whether simply cloning the Bitmask would be sufficient, since cloning is already extremely cheap.

Structs§

BitmaskV
BitmaskView