Serde

trait Serde[-R, T] extends Deserializer[R, T] with Serializer[R, T]

A serializer and deserializer for values of type T

Type parameters:
R

Environment available to the deserializer

T

Value type

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

Value members

Concrete methods

def asOption(implicit ev: T <:< AnyRef, ev2: Null <:< T): 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.

override def blocking: Serde[R & Blocking, 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.

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

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

Inherited methods

def asOption[U <: T](implicit ev: Null <:< 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.

Inherited from:
Serializer
def asOption(implicit @nowarn ev: T <:< AnyRef): 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.

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

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

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

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

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

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.

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