We need some way to support opening a bit-vector in read-only fashion. We had a readonly parameter on MmapBitVec::open at one point, but this doesn't work any more because upstream memmap split their base struct into mutable and non-mutable variants without a common trait to unify them (and passing a file created with OpenOptions::new()...write(false)... to a MmapMut initializer doesn't work either).
There are a few possible ways to do this:
- implement our own trait on
MmapMut and Mmap and store a boxed version of either in the MmapBitVec struct (this may give a perf hit?)
- create a separate
MmapBitVecReadOnly struct that implements BitVector too and let downstream choose
- fork memmap :/
We need some way to support opening a bit-vector in read-only fashion. We had a
readonlyparameter onMmapBitVec::openat one point, but this doesn't work any more because upstreammemmapsplit their base struct into mutable and non-mutable variants without a common trait to unify them (and passing a file created withOpenOptions::new()...write(false)...to a MmapMut initializer doesn't work either).There are a few possible ways to do this:
MmapMutandMmapand store a boxed version of either in the MmapBitVec struct (this may give a perf hit?)MmapBitVecReadOnlystruct that implements BitVector too and let downstream choose