Codec

object Codec
Companion:
class
trait Product
trait Mirror
class Object
trait Matchable
class Any
Codec.type

Type members

Classlikes

object ForEither

The default Codec for Either is not automatically in scope, because there is no clear "standard" way of encoding instances of Either.

The default Codec for Either is not automatically in scope, because there is no clear "standard" way of encoding instances of Either.

Inherited types

type MirroredElemLabels <: Tuple

The names of the product elements

The names of the product elements

Inherited from:
Mirror
type MirroredLabel <: String

The name of the type

The name of the type

Inherited from:
Mirror

Value members

Concrete methods

@inline
def bimap[A, B](f: B => A, g: A => B)(implicit ea: Encoder[A], da: Decoder[A]): Codec[B]

Constructs a Codec[B] from an Encoder[A], a Decoder[A] and two functions.

Constructs a Codec[B] from an Encoder[A], a Decoder[A] and two functions.

inline def forProduct[T <: Product](implicit m: ProductOf[T]): Codec[T]

Convenience constructor.

Convenience constructor.

@inline
def of[T](implicit encoder: Encoder[T], decoder: Decoder[T]): Codec[T]

Same as apply but with the parameter list marked as implicit.

Same as apply but with the parameter list marked as implicit.

@inline
def targetSpecific[T](cbor: Codec[T], json: Codec[T]): Codec[T]

Creates a "unified" Codec from two codecs that each target only a single data format.

Creates a "unified" Codec from two codecs that each target only a single data format.

Extensions

Extensions

extension [T](underlying: => Codec[T])

Wraps a Codec definition with lazy initialization.

Wraps a Codec definition with lazy initialization.