scalus.serialization.flat

Members list

Type members

Classlikes

class ArrayByteFlat extends Flat[Array[Byte]]

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
trait Flat[Array[Byte]]
class Object
trait Matchable
class Any
class DecoderState(val buffer: Uint8Array)

Attributes

Supertypes
class Object
trait Matchable
class Any
class EncoderState(bufferSize: Int)

Attributes

Supertypes
class Object
trait Matchable
class Any
trait Flat[A]
object FlatInstances

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
object HashConsed

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 Object
trait Matchable
class Any
Self type
HashConsed.type
class HashConsedDecoderState(val decode: DecoderState, val hashConsed: State, val debug: Boolean)

Attributes

Supertypes
class Object
trait Matchable
class Any
class HashConsedEncoderState(val encode: EncoderState, val hashConsed: State, val debug: Boolean)

Attributes

Companion
object
Supertypes
class Object
trait Matchable
class Any

Attributes

Companion
class
Supertypes
class Object
trait Matchable
class Any
Self type
trait HashConsedFlat[A] extends Flat[A]

Attributes

Companion
object
Supertypes
trait Flat[A]
class Object
trait Matchable
class Any
Known subtypes

Attributes

Companion
trait
Supertypes
class Object
trait Matchable
class Any
Self type
trait HashConsedMutRefReprFlat[A <: AnyRef, SA <: HashConsedRef[A]] extends HashConsedReprFlat[A, SA]

Attributes

Supertypes
trait HashConsedReprFlat[A, SA]
class Object
trait Matchable
class Any
Known subtypes
trait HashConsedRef[+A <: AnyRef]

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 Object
trait Matchable
class Any
Known subtypes
class CachedTaggedRef[A]
class ConstRef[A]
class ForwardRef[A]
class MutRef[A]
class ListRepl[A, SA]
class StringMapRep[A, SA]
Show all
object HashConsedRef

Attributes

Companion
trait
Supertypes
class Object
trait Matchable
class Any
Self type
trait HashConsedReprFlat[A <: AnyRef, SA <: HashConsedRef[A]]

Attributes

Companion
object
Supertypes
class Object
trait Matchable
class Any
Known subtypes

Attributes

Companion
trait
Supertypes
class Object
trait Matchable
class Any
Self type
case class Natural(n: BigInt)

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
object PlainIntFlat extends HashConsedFlat[Int]

Attributes

Supertypes
trait HashConsedFlat[Int]
trait Flat[Int]
class Object
trait Matchable
class Any
Self type
object given_Flat_BigInt extends Flat[BigInt]

Attributes

Supertypes
trait Flat[BigInt]
class Object
trait Matchable
class Any
Self type
object given_Flat_Boolean extends Flat[Boolean]

Attributes

Supertypes
trait Flat[Boolean]
class Object
trait Matchable
class Any
Self type
object given_Flat_Int extends Flat[Int]

Attributes

Supertypes
trait Flat[Int]
class Object
trait Matchable
class Any
Self type
object given_Flat_Long extends Flat[Long]

Attributes

Supertypes
trait Flat[Long]
class Object
trait Matchable
class Any
Self type
object given_Flat_Natural extends Flat[Natural]

Attributes

Supertypes
trait Flat[Natural]
class Object
trait Matchable
class Any
Self type
object given_Flat_String extends Flat[String]

Attributes

Supertypes
trait Flat[String]
class Object
trait Matchable
class Any
Self type
object given_Flat_Unit extends Flat[Unit]

Attributes

Supertypes
trait Flat[Unit]
class Object
trait Matchable
class Any
Self type

Types

type HSRIdentityHashMap = IdentityHashMap[HashConsedRef[_], HashConsedRef[_]]
type Uint8Array = Array[Byte]

Value members

Concrete methods

def byteAsBitString(b: Byte): String
def decode[A : Flat](dec: DecoderState): A
def encode[A : Flat](a: A, enc: EncoderState): Unit
def w7l(n: Long): List[Byte]
def w7l(n: BigInt): List[Byte]
def zagZig(u: Int): Int
def zagZig(u: Long): Long
def zagZig(u: BigInt): BigInt
def zigZag(x: Int): Int

ZigZag encoding https://gist.github.com/mfuerstenau/ba870a29e16536fdbaba Maps negative values to positive values while going back and forth (0 = 0, -1 = 1, 1 = 2, -2 = 3, 2 = 4, -3 = 5, 3 = 6 ...)

ZigZag encoding https://gist.github.com/mfuerstenau/ba870a29e16536fdbaba Maps negative values to positive values while going back and forth (0 = 0, -1 = 1, 1 = 2, -2 = 3, 2 = 4, -3 = 5, 3 = 6 ...)

Attributes

def zigZag(x: Long): Long
def zigZag(x: BigInt): BigInt

Extensions

Extensions

extension (s: State)
def finishCallbacks(debug: Boolean): Unit
def lookup(ihc: Int, tag: Tag): Option[Either[ForwardRefAcceptor, HashConsedRef[_]]]
def lookupValue(ihc: Int, tag: Tag): Option[HashConsedRef[_]]
def putForwardRef(ihc: Int, tag: Tag, action: AnyRef => Unit): Unit
def putForwardValueAcceptor[A <: AnyRef](ihc: Int, tag: Tag, acceptor: A => Unit): Unit
def setRef[A <: AnyRef](ihc: Int, tag: Tag, a: HashConsedRef[A]): Unit