Packages

trait GenCodec[T] extends AnyRef

Type class for types that can be serialized to Output (format-agnostic "output stream") and deserialized from Input (format-agnostic "input stream"). GenCodec is supposed to capture generic structure of serialized objects, without being bound to particular format like JSON. The actual format is determined by implementation of Input and Output.

There are convenient macros for automatic derivation of GenCodec instances (materialize and materializeRecursively). However, GenCodec instances still need to be explicitly declared and won't be derived "automagically".

Annotations
@implicitNotFound( "No GenCodec found for ${T}" )
Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. GenCodec
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Abstract Value Members

  1. abstract def read(input: Input): T

    Deserializes a value of type T from an Input.

  2. abstract def write(output: Output, value: T): Unit

    Serializes a value of type T into an Output.

Concrete Value Members

  1. final def transform[U](onWrite: (U) ⇒ T, onRead: (T) ⇒ U): GenCodec[U]

    Transforms this codec into a codec of other type using a bidirectional conversion between the original and new type.