kantan.codecs

Decoder

trait Decoder[E, D, F, R[DD] <: Decoder[E, DD, F, R]] extends Serializable

Parent trait for all type classes used to decode a useful type from an encoded value.

E

encoded type - what to decode from.

D

decoded type - what to decode to.

F

failure type - how to represent errors.

R

implementation type - what will be returned by the various map operations.

Self Type
R[D]
Linear Supertypes
Serializable, Serializable, AnyRef, Any
Known Subclasses
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. Decoder
  2. Serializable
  3. Serializable
  4. AnyRef
  5. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Abstract Value Members

  1. abstract def copy[DD](f: (E) ⇒ Result[F, DD]): R[DD]

    Clones this decoder to create a new one with a different decoding function.

    Clones this decoder to create a new one with a different decoding function.

    This is not meant to be called directly. If you feel you need to, you're probably looking for map.

    Attributes
    protected
  2. abstract def decode(e: E): Result[F, D]

    Decodes encoded data.

    Decodes encoded data.

    This method is safe, in that it won't throw for run-of-the-mill errors. Unrecoverable errors such as out of memory exceptions are still thrown, but that's considered valid exceptional cases, where incorrectly encoded data is just... normal.

    Callers that wish to fail fast and fail hard can use the unsafeDecode method instead.

Concrete Value Members

  1. final def !=(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  2. final def !=(arg0: Any): Boolean

    Definition Classes
    Any
  3. final def ##(): Int

    Definition Classes
    AnyRef → Any
  4. final def ==(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  5. final def ==(arg0: Any): Boolean

    Definition Classes
    Any
  6. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  7. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  8. final def eq(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  9. def equals(arg0: Any): Boolean

    Definition Classes
    AnyRef → Any
  10. def finalize(): Unit

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  11. final def getClass(): Class[_]

    Definition Classes
    AnyRef → Any
  12. def hashCode(): Int

    Definition Classes
    AnyRef → Any
  13. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  14. def map[DD](f: (D) ⇒ DD): R[DD]

    Creates a new Decoder instance that applies the specified function after decoding.

    Creates a new Decoder instance that applies the specified function after decoding.

    This is convenient when building Decoder instances: when writing a Decoder[E, D, F, R], it often happens that you already have an instance of Decoder[E, DD, F, R] and a D ⇒ DD.

  15. def mapResult[DD](f: (D) ⇒ Result[F, DD]): R[DD]

    Creates a new Decoder instance that applies the specified function after decoding.

    Creates a new Decoder instance that applies the specified function after decoding.

    This is similar to map, but is used for these cases when the transformation function is unsafe - you have a Decoder[String] and want to turn it into a Decoder[Int], for example.

  16. final def ne(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  17. final def notify(): Unit

    Definition Classes
    AnyRef
  18. final def notifyAll(): Unit

    Definition Classes
    AnyRef
  19. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  20. def toString(): String

    Definition Classes
    AnyRef → Any
  21. def unsafeDecode(e: E): D

    Decodes encoded data unsafely.

    Decodes encoded data unsafely.

    The main difference between this and decode is that the former throws exceptions when errors occur where the later safely encodes error conditions in its return type.

  22. final def wait(): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  23. final def wait(arg0: Long, arg1: Int): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  24. final def wait(arg0: Long): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from Serializable

Inherited from Serializable

Inherited from AnyRef

Inherited from Any

Ungrouped