Deserializer

zio.kafka.serde.Deserializer
See theDeserializer companion object
trait Deserializer[-R, +A]

Deserializer from byte array to a value of some type A.

Type parameters

A

Value type

R

Environment available to the deserializer

Attributes

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

Members list

Value members

Abstract methods

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

Concrete methods

Returns a new deserializer that deserializes values as Option values, mapping null data to None values.

Returns a new deserializer that deserializes values as Option values, mapping null data to None values.

Attributes

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

def blocking: Deserializer[R, A]

Returns a new deserializer that executes its deserialization function on the blocking thread pool.

Returns a new deserializer that executes its deserialization function on the blocking thread pool.

Attributes

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

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

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