pub unsafe trait NonZeroBitArray: Copy + Display + Debug + Eq + Hash + 'static {
    type Base: BitArray<NonZero = Self>;

    fn new(n: Self::Base) -> Option<Self>;
    unsafe fn new_unchecked(n: Self::Base) -> Self;
    fn get(self) -> Self::Base;
}
Expand description

A trait for bit strings like BitArray but with guaranteed nonzero values

Safety

Must guarantee that the value is indeed nonzero. Failing to do so could, e.g., cause a division by zero in entropy coders, which is undefined behavior.

Required Associated Types§

Required Methods§

Safety

The provided value n must be nonzero.

Implementations on Foreign Types§

Implementors§