package strings
Defines codecs for encoding to and decoding from strings.
These codecs are not necessary meant to use directly, but more as part of larger ones. kantan.csv, for example, works with CSV files but delegates the act of encoding to or decoding from a CSV cell to string codecs.
Default instances can be found in kantan.codecs.strings.codecs.
- Source
- package.scala
- Alphabetic
- By Inheritance
- strings
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Type Members
- sealed case class DecodeError(message: String) extends Error with Product with Serializable
- trait PlatformSpecificCodecs extends AnyRef
JVM-specific codecs.
- trait PlatformSpecificDecoders extends AnyRef
JVM-specific decoders.
- trait PlatformSpecificEncoders extends AnyRef
JVM-specific encoders.
- trait PlatformSpecificInstances extends AnyRef
JVM-specific codec instances.
- type StringCodec[A] = Codec[String, A, DecodeError, codecs.type]
Codec for strings.
- type StringDecoder[A] = Decoder[String, A, DecodeError, codecs.type]
Decoder for strings.
- type StringEncoder[A] = Encoder[String, A, codecs.type]
Encoder for strings.
- type StringResult[A] = Either[DecodeError, A]
Type of values values returned when attempting to decode a
String
.
Value Members
- object DecodeError extends ErrorCompanion[DecodeError]
- object StringCodec extends CodecCompanion[String, DecodeError, codecs.type] with PlatformSpecificCodecs
Provides instance creation methods.
Provides instance creation methods.
No instance summoning method is provided - this is by design. Developers should never work with codecs, but with instances of StringEncoder and StringDecoder instead. Codecs are merely meant as a declaration convenience.
Default instances are defined in codecs.
- object StringDecoder extends DecoderCompanion[String, DecodeError, codecs.type] with PlatformSpecificDecoders
Provides instance creation and summing methods for StringDecoder.
Provides instance creation and summing methods for StringDecoder.
Default StringDecoder instances are provided in codecs.
- object StringEncoder extends EncoderCompanion[String, codecs.type] with PlatformSpecificEncoders
- object StringResult extends WithError[DecodeError]
- object codecs extends PlatformSpecificInstances
Defines default instances for StringEncoder and StringDecoder.