Documentation

Projects.Util.Serializable.Serializer

structure Serializer :
Instances For
    def instDecidableEqSerializer.decEq (x✝ x✝¹ : Serializer) :
    Decidable (x✝ = x✝¹)
    Equations
    Instances For
      @[reducible, inline]
      abbrev Serializer.Ser (α : Type) :
      Equations
      Instances For
        Equations
        Instances For
          Equations
          Instances For
            Equations
            Instances For
              Equations
              Instances For
                Equations
                Instances For
                  @[simp]
                  theorem Serializer.writeBits_cons {b : Bit} {bs : List Bit} :
                  @[simp]
                  theorem Serializer.writeBits_append {bs₁ bs₂ : List Bit} :
                  writeBits (bs₁ ++ bs₂) = do writeBits bs₁ writeBits bs₂
                  @[simp]
                  theorem Serializer.ofBits_append {bs₁ bs₂ : List Bit} :
                  ofBits (bs₁ ++ bs₂) = (StateT.run (writeBits bs₂) (ofBits bs₁)).2
                  theorem Serializer.writeBit_eq_of_lt {s : Serializer} {b : Bit} (n : ) (h₁ : s.bitMask = 1 <<< UInt8.ofNat n) (h₂ : n 6) :
                  StateT.run (writeBit b) s = ((), { bytes := s.bytes, curByte := s.curByte ||| UInt8.ofBit b <<< UInt8.ofNat n, bitMask := 1 <<< UInt8.ofNat (n + 1) })
                  theorem Serializer.writeBits_eq_of_lt {s : Serializer} {bs : List Bit} (n : ) (h₁ : s.bitMask = 1 <<< UInt8.ofNat n) (h₂ : n + bs.length 7) :
                  StateT.run (writeBits bs) s = ((), { bytes := s.bytes, curByte := s.curByte ||| UInt8.ofBits bs <<< UInt8.ofNat n, bitMask := 1 <<< UInt8.ofNat (n + bs.length) })