scalus.serialization.flat
Members list
Type members
Classlikes
Prealigned Arrays of bytes PreAligned a ≡ PreAligned {preFiller :: Filler, preValue :: a}
Prealigned Arrays of bytes PreAligned a ≡ PreAligned {preFiller :: Filler, preValue :: a}
Filler ≡ FillerBit Filler | FillerEnd
Array v = A0 | A1 v (Array v) | A2 v v (Array v) ... | A255 ... (Array v)
Attributes
- Supertypes
Flat serialization instance for Data type.
Flat serialization instance for Data type.
This is kept separate from FlatInstances.scala because Data uses scalus.cardano.onchain.plutus.prelude.List, which is not available in the compiler plugin. The compiler plugin doesn't need to serialize Data values directly - it only needs the SIR/SIRType serialization from FlatInstances.
Attributes
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
DataFlatInstance.type
Mutable bit-level cursor over a flat-encoded byte array. Mirrors EncoderState: bits are read most-significant first within each byte.
Mutable bit-level cursor over a flat-encoded byte array. Mirrors EncoderState: bits are read most-significant first within each byte.
Attributes
- Supertypes
-
class Objecttrait Matchableclass Any
Mutable bit-level output buffer for flat encoding. Bits are accumulated into currentByte (most-significant first) and flushed to buffer one byte at a time. The caller must pre-size bufferSize from Flat.bitSize — the buffer does not grow.
Mutable bit-level output buffer for flat encoding. Bits are accumulated into currentByte (most-significant first) and flushed to buffer one byte at a time. The caller must pre-size bufferSize from Flat.bitSize — the buffer does not grow.
Attributes
- Supertypes
-
class Objecttrait Matchableclass Any
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.
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
- Supertypes
-
class Objecttrait Matchableclass Any
- Known subtypes
-
object given_Flat_Word64class ArrayByteFlatobject given_Flat_Dataobject SIRLetFlagsFlatobject SIRPositionFlatobject given_Flat_Dataobject given_Flat_Optionobject given_Flat_SIRVarStoragetrait HashConsedFlat[A]object ToExprHSSIRFlatobject ToExprHSSIRTypeFlatobject given_HashConsedFlat_Moduleobject given_HashConsedFlat_TypeVarobject PlainIntFlatobject given_Flat_BigIntobject given_Flat_Booleanobject given_Flat_Intobject given_Flat_Longobject given_Flat_Naturalobject given_Flat_Stringobject given_Flat_Unitobject given_Flat_ByteStringobject given_Flat_Dataobject given_Flat_DeBruijnedProgramobject given_Flat_DefaultFunobject given_Flat_TermShow all
Java-facing facade over the flat codec, and the home of the scalar helper implementations — the top-level functions of this package (zigZag, word7Bytes, ...) delegate here.
Java-facing facade over the flat codec, and the home of the scalar helper implementations — the top-level functions of this package (zigZag, word7Bytes, ...) delegate here.
A plain object without a companion class gets static forwarders in its mirror class, so Java calls FlatCodec.encodeLong(v) directly on every platform — no MODULE$, no summon. Signatures use only byte[]/primitive/String types plus explicit Flat instances (see Flats) so Java never has to name a Scala collection or summon a given.
Attributes
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
FlatCodec.type
Attributes
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
FlatInstances.type
Named accessors for the primitive Flat instances, since Java cannot summon.
Named accessors for the primitive Flat instances, since Java cannot summon.
Attributes
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
Flats.type
Objects are hash-consed during restoring from file. Note, that identityHashCode can be different on the different VM-s, so it is not safe to reky on it. value-based hash-code now is not determenistics on recuresive data structures with self-references. So, we use identityHashCode on VN which store file and restore internal references on other VN.
Objects are hash-consed during restoring from file. Note, that identityHashCode can be different on the different VM-s, so it is not safe to reky on it. value-based hash-code now is not determenistics on recuresive data structures with self-references. So, we use identityHashCode on VN which store file and restore internal references on other VN.
Attributes
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
HashConsed.type
Attributes
- Supertypes
-
class Objecttrait Matchableclass Any
Attributes
- Companion
- object
- Supertypes
-
class Objecttrait Matchableclass Any
Attributes
- Companion
- class
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
Attributes
- Companion
- object
- Supertypes
- Known subtypes
-
object ToExprHSSIRFlatobject ToExprHSSIRTypeFlatobject given_HashConsedFlat_Moduleobject given_HashConsedFlat_TypeVarobject PlainIntFlat
Attributes
- Companion
- trait
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
HashConsedFlat.type
Attributes
- Supertypes
- Known subtypes
-
object ConstrDeclFlatobject DataDeclFlatobject SIRTypeCaseClassFlatobject SIRTypeNonCaseModuleFlatobject SIRTypeSumCaseClassFlat
When we read from the HashConsedRead.State, we can have forward references, which will be resolved after the whole structure is readed. Here, HashConsedRef can hold object ro Ref or object of some intermediate representation, which holds other refs.
When we read from the HashConsedRead.State, we can have forward references, which will be resolved after the whole structure is readed. Here, HashConsedRef can hold object ro Ref or object of some intermediate representation, which holds other refs.
Attributes
- Companion
- object
- Supertypes
-
class Objecttrait Matchableclass Any
- Known subtypes
-
class SIRTypeHashConsedRefclass CachedTaggedRef[A]class ConstRef[A]class ForwardRef[A]class MutRef[A]Show all
Attributes
- Companion
- trait
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
HashConsedRef.type
Attributes
- Companion
- trait
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
HashConsedReprFlat.type
Attributes
- Companion
- object
- Supertypes
-
class Objecttrait Matchableclass Any
- Known subtypes
-
object AnnotationsDeclFlatobject BindingFlatobject ModuleHashSetReprFlatobject SIRCaseHashConsedFlatobject SIRConstHashConsedFlatobject SIRDeclHashConsedFlatobject SIRHashConsedFlatobject SIRLetHashConsedFlatobject SIRTypeHashConsedFlatobject SIRTypeTypeProxyFlatobject SIRVarHashConsedFlatobject TypeBindingFlatobject ConstrDeclFlatobject DataDeclFlatobject SIRTypeCaseClassFlatobject SIRTypeNonCaseModuleFlatobject SIRTypeSumCaseClassFlatShow all
A non-negative integer, encoded as an unsigned varint (no zigzag), matching flat's Natural.
A non-negative integer, encoded as an unsigned varint (no zigzag), matching flat's Natural.
Attributes
- Supertypes
-
trait Serializabletrait Producttrait Equalsclass Objecttrait Matchableclass AnyShow all
Attributes
- Supertypes
- Self type
-
PlainIntFlat.type
Attributes
- Supertypes
- Self type
-
given_Flat_BigInt.type
Attributes
- Supertypes
- Self type
-
given_Flat_Boolean.type
Attributes
- Supertypes
- Self type
-
given_Flat_Int.type
Attributes
- Supertypes
- Self type
-
given_Flat_Long.type
Attributes
- Supertypes
- Self type
-
given_Flat_Natural.type
Attributes
- Supertypes
- Self type
-
given_Flat_String.type
Attributes
- Supertypes
- Self type
-
given_Flat_Unit.type
Types
Value members
Concrete methods
Renders a byte as its 8-character binary string, e.g. 0x0b → "00001011". Debug aid for EncoderState.toString/DecoderState.toString.
Renders a byte as its 8-character binary string, e.g. 0x0b → "00001011". Debug aid for EncoderState.toString/DecoderState.toString.
Attributes
Flat encoding for collections as flat lists: each element is prefixed by a 1 bit, terminated by a 0 bit (List a = Nil | Cons a (List a) with one tag bit per node).
Flat encoding for collections as flat lists: each element is prefixed by a 1 bit, terminated by a 0 bit (List a = Nil | Cons a (List a) with one tag bit per node).
Attributes
Encodes n (treated as an unsigned 64-bit value) as a variable-length byte array: 7 payload bits per byte, least-significant group first, high bit set on every byte except the last. This is the byte layout of flat's data NonEmptyList = Elem Word7 | Cons Word7 NonEmptyList.
Encodes n (treated as an unsigned 64-bit value) as a variable-length byte array: 7 payload bits per byte, least-significant group first, high bit set on every byte except the last. This is the byte layout of flat's data NonEmptyList = Elem Word7 | Cons Word7 NonEmptyList.
Attributes
Number of bytes in the variable-length 7-bit encoding of n, treating n as an unsigned 64-bit value.
Number of bytes in the variable-length 7-bit encoding of n, treating n as an unsigned 64-bit value.
Attributes
Inverse of zigZag(x:Int)*.
ZigZag encoding: maps signed values to unsigned so small magnitudes of either sign get short varint encodings (0 → 0, -1 → 1, 1 → 2, -2 → 3, 2 → 4, ...). Total over the whole Int/Long range: the doubling overflow is intentional and is inverted by zagZig. https://gist.github.com/mfuerstenau/ba870a29e16536fdbaba
ZigZag encoding: maps signed values to unsigned so small magnitudes of either sign get short varint encodings (0 → 0, -1 → 1, 1 → 2, -2 → 3, 2 → 4, ...). Total over the whole Int/Long range: the doubling overflow is intentional and is inverted by zagZig. https://gist.github.com/mfuerstenau/ba870a29e16536fdbaba