Codec

endpoints4s.Codec
See theCodec companion trait
object Codec

Attributes

Companion
trait
Graph
Supertypes
class Object
trait Matchable
class Any
Self type
Codec.type

Members list

Value members

Concrete methods

def fromEncoderAndDecoder[E, D](encoder: Encoder[D, E])(decoder: Decoder[E, D]): Codec[E, D]
def parseStringCatchingExceptions[A](`type`: String, parse: String => A, print: A => String): Codec[String, A]

Produce a codec to/from a string. If the parsing function fails, the decoding output is an Invalid with a message mentioning the type name.

Produce a codec to/from a string. If the parsing function fails, the decoding output is an Invalid with a message mentioning the type name.

Value parameters

parse

parsing function to use, with exceptions turned into Invalid

print

printing function to use, not supposed to throw exceptions

type

name of the type being decoded

Attributes

def sequentially[A, B, C](ab: Codec[A, B])(bc: Codec[B, C]): Codec[A, C]

Combines two codecs, sequentially, by feeding the input of the second one with the output of the first one

Combines two codecs, sequentially, by feeding the input of the second one with the output of the first one

Attributes