Serde

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

A serializer and deserializer for values of type T

Attributes

R

Environment available to the deserializer

T

Value type

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

Members list

Concise view

Value members

Concrete methods

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

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

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

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

Attributes

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

Converts to a Serde of type U with pure transformations

Converts to a Serde of type U with pure transformations

Attributes

def inmapM[R1 <: R, U](f: T => RIO[R1, U])(g: U => RIO[R1, T]): Serde[R1, U]

Convert to a Serde of type U with effectful transformations

Convert to a Serde of type U with effectful transformations

Attributes

Inherited 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

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

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

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

Inherited from:
Serializer
def deserialize(topic: String, headers: Headers, data: Array[Byte]): RIO[R, T]

Attributes

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

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

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

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

Attributes

Inherited from:
Serializer