Variant

zio.blocks.schema.binding.Binding.Variant
See theVariant companion object
final case class Variant[A](discriminator: Discriminator[A], matchers: Matchers[A]) extends Binding[Variant, A]

The binding of a variant node, such as a sealed trait or an enum. discriminator returns the index of the case that a value belongs to, and matchers holds one Matcher per case. Both follow the order of the node's cases: case i of the node is matched by matchers(i), and its values are discriminated as i.

Attributes

Companion
object
Source
Binding.scala
Graph
Supertypes
trait Serializable
trait Product
trait Equals
trait Binding[Variant, A]
class Object
trait Matchable
class Any
Show all

Members list

Value members

Inherited methods

def productElementNames: Iterator[String]

An iterator over the names of all the elements of this product.

An iterator over the names of all the elements of this product.

Attributes

Inherited from:
Product
Source
Product.scala
def productIterator: Iterator[Any]

An iterator over all the elements of this product.

An iterator over all the elements of this product.

Attributes

Returns

in the default implementation, an Iterator[Any]

Inherited from:
Product
Source
Product.scala