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
- Known subtypes
-
object AvroFormatobject JsonFormatobject MessagePackFormatobject ThriftFormatobject ToonFormatobject XmlFormatobject YamlFormat
Members list
In this article