Flat

scalus.serialization.flat.Flat
trait Flat[A]

Type class for the flat binary encoding (a bit-oriented serialization format, see https://hackage.haskell.org/package/flat and the Plutus Core specification, Appendix D). UPLC programs and SIR modules are serialized with instances of this trait.

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Known subtypes

Members list

Value members

Abstract methods

def bitSize(a: A): Int

Exact size of the encoding of a in bits. Callers use it to size the EncoderState buffer, so it must never under-estimate.

Exact size of the encoding of a in bits. Callers use it to size the EncoderState buffer, so it must never under-estimate.

Attributes

def decode(decode: DecoderState): A
def encode(a: A, encode: EncoderState): Unit