BinaryFormat

zio.blocks.schema.codec.BinaryFormat
abstract class BinaryFormat[TC <: (BinaryCodec)](val mimeType: String, val deriver: Deriver[TC]) extends Format

A tag that can be used to uniquely identify a binary format, such as Avro. Each format should have its own nominal type, together with a singleton value of that type.

e.g.:

import zio.blocks.schema.codec._
import zio.blocks.schema.derive.Deriver

abstract class AvroCodec[A] extends BinaryCodec[A]
lazy val AvroDeriver: Deriver[AvroCodec] = ??? // the deriver of your codecs

sealed abstract class Avro extends BinaryFormat[AvroCodec]("application/avro", AvroDeriver)
case object Avro extends Avro

Attributes

Source
Format.scala
Graph
Supertypes
trait Format
class Object
trait Matchable
class Any
Known subtypes
object AvroFormat
object JsonFormat
object ThriftFormat
object ToonFormat
object XmlFormat
object YamlFormat
Show all

Members list

Type members

Types

Attributes

Source
Format.scala

Attributes

Source
Format.scala
final type TypeClass[A] = TC[A]

Attributes

Source
Format.scala

Value members

Concrete fields

val deriver: Deriver[TC]

Attributes

Source
Format.scala
val mimeType: String

Attributes

Source
Format.scala

Implicits

Implicits

final implicit def derivable: Derivable[this.type, TC]

Attributes

Source
Format.scala