Serializer

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

Serializer from values of some type A to a byte array.

Type parameters

R

Environment available to the serializer

Attributes

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

Members list

Value members

Abstract methods

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

Concrete methods

def asOption[A1 <: A]: Serializer[R, Option[A1]]

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, A]

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

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

Attributes

def contramap[B](f: B => A): Serializer[R, B]

Create a serializer for a type B based on the serializer for type A and a mapping function.

Create a serializer for a type B based on the serializer for type A and a mapping function.

Attributes

def contramapZIO[R1 <: R, B](f: B => RIO[R1, A]): Serializer[R1, B]

Create a serializer for a type B based on the serializer for type A and an effectful mapping function.

Create a serializer for a type B based on the serializer for type A and an effectful mapping function.

Attributes