io.github.raptros

bson

package bson

root package of the-bson.

Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. bson
  2. AnyRef
  3. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Type Members

  1. trait Bson extends Extractors with Builders with EncodeBsonFields with EncodeBsons with DecodeBsonFields with DecodeBsons with CodecBsons

    instead of importing, you could mix in Bson.

    instead of importing, you could mix in Bson. if anyone finds a good use case for that, let me know.

  2. trait Builders extends AnyRef

    Builders are all the things you need to build up DBObjects using available EncodeBsons and EncodeBsonFields.

  3. sealed trait CodecBson[A] extends EncodeBson[A] with DecodeBson[A]

    CodecBson is both an EncodeBson and a DecodeBson.

    CodecBson is both an EncodeBson and a DecodeBson.

    A

    the type this codec encodes and decodes.

  4. trait CodecBsons extends GeneratedCodecBsons

    contains a number of autogenerated bsonCaseCodec methods, which (for each arity) take apply and unapply functions and a number of field names, and produce CodecBsons.

  5. case class CustomError(msg: String) extends DecodeError with Product with Serializable

  6. trait DecodeBson[+A] extends AnyRef

    the typeclass of things that can be decoded from DBObjects.

    the typeclass of things that can be decoded from DBObjects.

    A

    not certain what effect the covariance on A has.

  7. trait DecodeBsonField[+A] extends AnyRef

    an instance of DecodeBsonField for a type A can extract an A from a field of a db object.

  8. trait DecodeBsonFields extends AnyRef

  9. trait DecodeBsons extends GeneratedDecodeBsons

    this contains:

    this contains:

    • a couple DecodeBson instances
    • two Applicative implementations (one for DecodeResult, one for the scalaz.Validation equivalent)
    • a bunch of bdecode(n)f methods, which construct decoders from the combination of function that constructs a value from types that have DecodeBsonField instances, and a list of field names to extracted. n is the arity.
    • a bunch of bdecodeTuple(n) methods, which constructed decoders that extract the named fields into a tuple.
  10. sealed trait DecodeError extends AnyRef

    the base type of things that can go wrong when decoding a DBO.

  11. type DecodeResult[+A] = \/[NonEmptyList[DecodeError], A]

    decode result is either a non-empty list of errors, or some value.

  12. trait EncodeBson[-A] extends AnyRef

    instances of this trait encode things to DBObjects.

    instances of this trait encode things to DBObjects.

    A

    the type that this can encode. contravariant so that this can be used in any situation where a subtype of A needs to be encoded.

  13. trait EncodeBsonField[-A] extends AnyRef

    these allow things of type A to be written into DBObjects as keyed values.

    these allow things of type A to be written into DBObjects as keyed values. this is important because with BSON the only valid database objects are, well, objects.

    A

    the type that can be encoded. contravariant for the same reason as EncodeBson.

  14. trait EncodeBsonFields extends AnyRef

  15. trait EncodeBsons extends GeneratedEncodeBsons

    contains:

    contains:

    • at least one encoder implementation
    • methods named bencode(n)f (of arity n) that take a function that converts some type X into an n-tuple of things that have EncodeBsonField instances, along with the n field names to insert the encoded values with
  16. trait Extractors extends AnyRef

    contains any utilies for using decoders

  17. trait GeneratedCodecBsons extends AnyRef

  18. trait GeneratedDecodeBsons extends AnyRef

  19. trait GeneratedEncodeBsons extends AnyRef

  20. case class NoSuchField(field: String) extends DecodeError with Product with Serializable

  21. case class WrongFieldCount(expected: Int, got: Int) extends DecodeError with Product with Serializable

  22. case class WrongFieldType(field: String, wanted: Class[_], got: Class[_]) extends DecodeError with Product with Serializable

  23. case class WrongType(wanted: Class[_], got: Class[_]) extends DecodeError with Product with Serializable

Value Members

  1. object Bson extends Bson

    all of the features in core can be imported by importing Bson.

    all of the features in core can be imported by importing Bson._; generally speaking that is what you want.

  2. object BsonMacros

    this object provides several macro implementations for automatically deriving encode and decode type classes for case classes.

    this object provides several macro implementations for automatically deriving encode and decode type classes for case classes. they all work about the same way:

    • extract the main constructor for the class
    • find the generated encode/decode/codec method that has the same arity as that constructor (note that the macros fail if they can't find one)
    • find the companion object and refer to the apply or unapply method (note that case classes that use unapplySeq won't work)
    • construct the call to the coding method, using the names of the constructor parameters as the strings for the fields
    • use the types of the constructor params to pass in implicitly available EncodeBson and DecodeBson instances for the fields
  3. object Builders extends Builders

  4. object CodecBson extends CodecBsons

  5. object DecodeBson extends DecodeBsons

  6. object DecodeBsonField extends DecodeBsonFields

  7. object EncodeBson extends EncodeBsons

  8. object EncodeBsonField extends EncodeBsonFields

  9. object Extractors extends Extractors

Inherited from AnyRef

Inherited from Any

Ungrouped