Serde

zio.kafka.serde.Serde
See theSerde companion object
trait Serde[-R, A] extends Deserializer[R, A], Serializer[R, A]

A serializer and deserializer for values of type A.

Type parameters

A

Value type

R

Environment available to the deserializer

Attributes

Companion
object
Graph
Supertypes
trait Serializer[R, A]
trait Deserializer[R, A]
class Object
trait Matchable
class Any

Members list

Value members

Concrete methods

override def asOption: Serde[R, Option[A]]

Creates a new Serde that uses optional values. Null data will be mapped to None values.

Creates a new Serde that uses optional values. Null data will be mapped to None values.

Attributes

Definition Classes
override def blocking: Serde[R, A]

Creates a new Serde that executes its serialization and deserialization functions on the blocking thread pool.

Creates a new Serde that executes its serialization and deserialization functions on the blocking thread pool.

Attributes

Definition Classes
def inmap[B](f: A => B)(g: B => A): Serde[R, B]

Converts to a Serde of type B with pure transformations.

Converts to a Serde of type B with pure transformations.

Attributes

def inmapZIO[R1 <: R, B](f: A => RIO[R1, B])(g: B => RIO[R1, A]): Serde[R1, B]

Convert to a Serde of type B with effectful transformations.

Convert to a Serde of type B with effectful transformations.

Attributes

Inherited 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

Inherited from:
Serializer
def asTry: Deserializer[R, Try[A]]

Serde that handles deserialization failures by returning a Task.

Serde that handles deserialization failures by returning a Task.

This is useful for explicitly handling deserialization failures.

Attributes

Inherited from:
Deserializer
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

Inherited from:
Serializer
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

Inherited from:
Serializer
def map[B](f: A => B): Deserializer[R, B]

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

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

Attributes

Inherited from:
Deserializer
def mapZIO[R1 <: R, B](f: A => RIO[R1, B]): Deserializer[R1, B]

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

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

Attributes

Inherited from:
Deserializer
def orElse[R1 <: R, A1 >: A](alternative: Deserializer[R1, A1]): Deserializer[R1, A1]

When this serializer fails, attempt to deserialize with the alternative.

When this serializer fails, attempt to deserialize with the alternative.

If both deserializers fail, the error will be the last deserializer's exception.

Attributes

Inherited from:
Deserializer

Inherited and Abstract methods

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

Attributes

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

Attributes

Inherited from:
Serializer