Packages

package derived

import reactivemongo.bson.{derived, BSONDocumentHandler}

sealed trait Foo
case class Bar(i: Int, s: String) extends Foo
case class Baz(b: Boolean) extends Foo

object Foo {
  implicit val codec: BSONDocumentHandler[Foo] = derived.codec
}
Source
package.scala
Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. derived
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Type Members

  1. trait DerivedDecoder [A0, A] extends BSONDocumentReader[A]

    A0

    Phantom type keeping track of the original type to derive a decoder for

    A

    Decoded type

    Annotations
    @implicitNotFound( ... )
  2. trait DerivedDecoderLowPriority extends AnyRef
  3. trait DerivedEncoder [A] extends BSONDocumentWriter[A]
    Annotations
    @implicitNotFound( ... )
  4. trait DerivedEncoderLowPriority extends AnyRef

Value Members

  1. def codec[A](implicit decoder: Lazy[DerivedDecoder[_, A]], encoder: Lazy[DerivedEncoder[A]]): BSONDocumentHandler[A]
  2. def decoder[A](implicit decoder: Lazy[DerivedDecoder[_, A]]): BSONDocumentReader[A]
  3. def encoder[A](implicit encoder: Lazy[DerivedEncoder[A]]): BSONDocumentWriter[A]
  4. object DerivedDecoder extends DerivedDecoderLowPriority

    As usual the derivation process is as follows:

    As usual the derivation process is as follows:

    • let shapeless represent our type A in terms of Coproduct (if it is a sealed trait) or HList (if it is a case class) ;
    • define how to decode Coproducts and HLists using implicit definitions
  5. object DerivedEncoder extends DerivedEncoderLowPriority

Inherited from AnyRef

Inherited from Any

Ungrouped