zio.blocks.schema.binding.Binding.Record
See theRecord companion object
final case class Record[A](constructor: Constructor[A], deconstructor: Deconstructor[A]) extends Binding[Record, A]
The binding of a record node, such as a case class. constructor builds a value from Registers, and deconstructor writes a value's fields into them.
Both must use the layout that Reflect.Record#registers computes from the node's fields. In field order, a field stored as a Boolean, Byte, Short, Char, Int, Float, Long or Double takes the next position of its size in the byte area, a Unit field takes no space, and every other field takes the next object slot (see Register). Reflect.Record#fromDynamicValue and #toDynamicValue move each field through that layout, so a binding with a different layout reads the wrong registers.
Attributes
- Companion
- object
- Source
- Binding.scala
- Graph
-
- Supertypes
Members list
In this article