noodles_cram/codecs/rans_nx16/
flags.rs

1bitflags::bitflags! {
2    /// rANS Nx16 flags.
3    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
4    pub struct Flags: u8 {
5        /// Order-1 entropy coding.
6        const ORDER = 0x01;
7        /// Reserved.
8        const RESERVED = 0x02;
9        /// Interleave 32 rANS states.
10        const N32 = 0x04;
11        /// Interleave byte streams.
12        const STRIPE = 0x08;
13        /// Discard the uncompressed data size.
14        const NO_SIZE = 0x10;
15        /// Data is uncompressed.
16        const CAT = 0x20;
17        /// Use run-length encoding.
18        const RLE = 0x40;
19        /// Use bit packing.
20        const PACK = 0x80;
21    }
22}
23
24impl From<u8> for Flags {
25    fn from(n: u8) -> Self {
26        Self::from_bits_truncate(n)
27    }
28}
29
30impl From<Flags> for u8 {
31    fn from(flags: Flags) -> Self {
32        flags.bits()
33    }
34}