Serializer

zio.kafka.serde.Serializer
See theSerializer companion object
trait Serializer[-R, -T]

Serializer from values of some type T to a byte array

Attributes

R

Environment available to the serializer

Companion:
object
Graph
Supertypes
class Object
trait Matchable
class Any
Known subtypes
trait Serde[R, T]

Members list

Concise view

Value members

Abstract methods

def serialize(topic: String, headers: Headers, value: T): RIO[R, Array[Byte]]

Concrete methods

def asOption[U <: T]: Serializer[R, Option[U]]

Returns a new serializer that handles optional values and serializes them as nulls.

Returns a new serializer that handles optional values and serializes them as nulls.

Attributes

def blocking: Serializer[R, T]

Returns a new serializer that executes its serialization function on the blocking threadpool.

Returns a new serializer that executes its serialization function on the blocking threadpool.

Attributes

def contramap[U](f: U => T): Serializer[R, U]

Create a serializer for a type U based on the serializer for type T and a mapping function

Create a serializer for a type U based on the serializer for type T and a mapping function

Attributes

def contramapM[R1 <: R, U](f: U => RIO[R1, T]): Serializer[R1, U]

Create a serializer for a type U based on the serializer for type T and an effectful mapping function

Create a serializer for a type U based on the serializer for type T and an effectful mapping function

Attributes