ConstantConstructor

zio.blocks.schema.binding.ConstantConstructor
class ConstantConstructor[A](constant: A) extends Constructor[A]

A constructor that uses no registers and always returns constant. Binding.of uses it for case objects and for Scala 3 enum cases without parameters.

Attributes

Source
Constructor.scala
Graph
Supertypes
class Constructor[A]
class Object
trait Matchable
class Any

Members list

Value members

Concrete methods

def construct(in: Registers, offset: RegisterOffset): A

Builds an A from the values in in, at positions counted from offset.

Builds an A from the values in in, at positions counted from offset.

Attributes

Source
Constructor.scala

The registers that construct reads, counted from its offset: the number of object slots and the number of bytes. Callers size their Registers with it.

The registers that construct reads, counted from its offset: the number of object slots and the number of bytes. Callers size their Registers with it.

Attributes

Source
Constructor.scala