1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
use crate::linear_combination::LinearCombination;

/// A `LinearCombination` whose value is known to be binary.
struct Bit {
    value: LinearCombination,
}

impl Bit {
    ///
    fn new_unsafe(value: LinearCombination) -> Self {
        Bit { value }
    }
}

/// A sequence of bits which encode an unsigned integer.
struct Bits {
    bits: Vec<Bit>,
}

impl Bits {
    fn len(&self) -> usize {
        self.bits.len()
    }
}