TextFormat

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

A tag that can be used to uniquely identify a text format, such as ZioJson. 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 ZioJsonCodec[A] extends TextCodec[A]
lazy val ZioJsonDeriver: Deriver[ZioJsonCodec] = ??? // the deriver of your codecs

sealed abstract class ZioJson extends TextFormat[ZioJsonCodec]("application/zio-json", ZioJsonDeriver)
case object ZioJson extends ZioJson

Attributes

Source
Format.scala
Graph
Supertypes
trait Format
class Object
trait Matchable
class Any
Known subtypes
object CsvFormat

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