zio.blocks.schema.codec

Members list

Type members

Classlikes

abstract class BinaryCodec[A] extends Codec[ByteBuffer, ByteBuffer, A]

Represents a specialized codec for encoding and decoding values between binary input and output representations using ByteBuffer.

Represents a specialized codec for encoding and decoding values between binary input and output representations using ByteBuffer.

This abstraction is commonly used with binary formats (e.g., Avro) where both encoding and decoding operations are performed using ByteBuffer as the underlying data representation.

Type parameters

A

The type of values being encoded or decoded.

Attributes

Source
BinaryCodec.scala
Supertypes
class Object
trait Matchable
class Any
Known subtypes
class AvroCodec[A]
class JsonCodec[A]
class MessagePackCodec[A]
class ThriftCodec[A]
class ToonCodec[A]
class XmlCodec[A]
class YamlCodec[A]
Show all
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.

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
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
abstract class Codec[DecodeInput, EncodeOutput, Value]

Represents an abstraction for encoding and decoding values between a specific input representation and a specific output representation.

Represents an abstraction for encoding and decoding values between a specific input representation and a specific output representation.

Type parameters

DecodeInput

The type of input data used for decoding operations.

EncodeOutput

The type of output data used for encoding operations.

Value

The type of values being encoded or decoded.

Attributes

Source
Codec.scala
Supertypes
class Object
trait Matchable
class Any
Known subtypes
class BinaryCodec[A]
class AvroCodec[A]
class JsonCodec[A]
class MessagePackCodec[A]
class ThriftCodec[A]
class ToonCodec[A]
class XmlCodec[A]
class YamlCodec[A]
class TextCodec[A]
class CsvCodec[A]
class HeaderCodec[A]
class QueryCodec[A]
Show all
sealed trait Format

A format is a type that represents a specific serialization format, such as Avro or JSON. Each format should have a unique MIME type that identifies it, which is used both for debugging purposes, and potentially in transport, depending on the protocol.

A format is a type that represents a specific serialization format, such as Avro or JSON. Each format should have a unique MIME type that identifies it, which is used both for debugging purposes, and potentially in transport, depending on the protocol.

A format is associated with a specific type class, such as BinaryCodec for binary formats, or TextCodec for text formats, and a deriver that can be used to derive the codec for the format.

Attributes

Source
Format.scala
Supertypes
class Object
trait Matchable
class Any
Known subtypes
class BinaryFormat[TC]
object AvroFormat
object JsonFormat
object ThriftFormat
object ToonFormat
object XmlFormat
object YamlFormat
class TextFormat[TC]
object CsvFormat
Show all
abstract class TextCodec[A] extends Codec[CharBuffer, CharBuffer, A]

Represents a specialized codec for encoding and decoding values between text-based input and output representations using CharBuffer.

Represents a specialized codec for encoding and decoding values between text-based input and output representations using CharBuffer.

This abstraction is typically used with text-based formats (e.g., JSON) where both encoding and decoding operations are performed using CharBuffer as the underlying data representation.

Type parameters

A

The type of values being encoded or decoded.

Attributes

Source
TextCodec.scala
Supertypes
class Object
trait Matchable
class Any
Known subtypes
class CsvCodec[A]
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.

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
Supertypes
trait Format
class Object
trait Matchable
class Any
Known subtypes
object CsvFormat