Deserializer

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

Deserializer from byte array to a value of some type T

Attributes

R

Environment available to the deserializer

T

Value type

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 deserialize(topic: String, headers: Headers, data: Array[Byte]): RIO[R, T]

Concrete methods

def asOption: Deserializer[R, Option[T]]

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[T]]

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

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

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

Attributes

def map[U](f: T => U): Deserializer[R, U]

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

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

Attributes

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

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

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

Attributes

def orElse[R1 <: R, U >: T](alternative: Deserializer[R1, U]): Deserializer[R1, U]

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