Codec

zio.blocks.schema.codec.Codec
abstract class Codec[DecodeInput, EncodeOutput, Value]

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
Graph
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

Members list

Value members

Abstract methods

def decode(input: DecodeInput): Either[SchemaError, Value]

Decodes the specified input into a value of the target type.

Decodes the specified input into a value of the target type.

Value parameters

input

The input data that needs to be decoded.

Attributes

Returns

Either a SchemaError indicating the decoding failure, or a decoded value.

Source
Codec.scala
def encode(value: Value, output: EncodeOutput): Unit

Encodes the given value into the specified output representation.

Encodes the given value into the specified output representation.

Value parameters

output

The target output into which the value will be encoded.

value

The value to be encoded.

Attributes

Returns

This method does not return a value.

Source
Codec.scala