ru.johnspade.csv3s.codecs

Type members

Classlikes

enum DecodeError(msg: String) extends ReadError

Parent type for all errors that can occur while decoding CSV data.

Parent type for all errors that can occur while decoding CSV data.

trait Decoder[E, D, F]

Type class for types that can be decoded from other types.

Type class for types that can be decoded from other types.

Type Params
D

decoded type - what to decode to.

E

encoded type - what to decode from.

F

failure type - how to represent errors.

trait Encoder[E, D]

Type class for types that can be encoded into others.

Type class for types that can be encoded into others.

Type Params
D

decoded type - what to encode from.

E

encoded type - what to encode to.

abstract
class Error(message: String) extends Exception with Product with Serializable
enum ParseError(msg: String) extends ReadError

Parent type for all errors that can occur while parsing CSV data.

Parent type for all errors that can occur while parsing CSV data.

sealed abstract
class ReadError(msg: String) extends Error

Parent type for all errors that can occur while dealing with CSV data.

Parent type for all errors that can occur while dealing with CSV data.

ReadError is split into two main error types:

  • DecodeError: errors that occur while decoding a cell or a row.
  • ParseError: errors that occur while parsing raw data into CSV.
object RowDecoder extends ProductDerivation[RowDecoder]
object RowEncoder extends ProductDerivation[RowEncoder]

Types

type DecodeResult[A] = Either[DecodeError, A]
type FieldEncoder[A] = Encoder[Field, A]
type RowEncoder[A] = Encoder[Row, A]
type StringDecoder[A] = Decoder[String, A, DecodeError]
type StringEncoder[A] = Encoder[String, A]