sealed trait RichTextCodec[A] extends AnyRef
A RichTextCodec
is a more compositional version of TextCodec
, which has
similar power to traditional parser combinators / pretty printers. Although
slower than the simpler text codecs, they can be utilized to parse structured
information in HTTP headers, which in turn allows generating much better
error messages and documentation than otherwise possible.
- Self Type
- RichTextCodec[A]
- Alphabetic
- By Inheritance
- RichTextCodec
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- final def <~(that: => RichTextCodec[Unit]): RichTextCodec[A]
Returns a new codec that is the sequential composition of this codec and the specified codec, but which only produces the value of this codec.
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ?!(label: String): Tagged[A]
Tags the codec with a label used in the documentation.
Tags the codec with a label used in the documentation. The label will be used but not explained
- final def ??(label: String): Tagged[A]
Tags the codec with a label used in the documentation
- final def as[B](b: => B)(implicit ev: =:=[A, Unit]): RichTextCodec[B]
Tranforms this constant unit codec to a constant codec of another type.
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- final def asType[B](implicit ev: =:=[A, B]): RichTextCodec[B]
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native() @HotSpotIntrinsicCandidate()
- final def collectOrFail(failure: String)(pf: PartialFunction[A, A]): RichTextCodec[A]
- final def const(canonical: A): RichTextCodec[Unit]
Converts this codec of
A
into a codec ofUnit
by specifying a canonical value to use when an HTTP client needs to generate a value for this codec. - final def decode(value: CharSequence): Either[String, A]
- final def describe: Doc
Constructs documentation for this rich text codec.
- final def encode(value: A): Either[String, String]
Encodes a value into a string, or if this is not possible, fails with an error message.
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- final def optional(default: A): RichTextCodec[Option[A]]
- lazy val repeat: RichTextCodec[Chunk[A]]
- final def singleton: RichTextCodec[NonEmptyChunk[A]]
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- final def tagged(label: String): Tagged[A]
- final def taggedUnexplained(label: String): Tagged[A]
- def toString(): String
- Definition Classes
- AnyRef → Any
- final def transform[B](f: (A) => B, g: (B) => A): RichTextCodec[B]
- final def transformOrFail[B](f: (A) => Either[String, B], g: (B) => Either[String, A]): RichTextCodec[B]
- final def transformOrFailLeft[B](f: (A) => Either[String, B], g: (B) => A): RichTextCodec[B]
- final def transformOrFailRight[B](f: (A) => B, g: (B) => Either[String, A]): RichTextCodec[B]
- final def validate(failure: String)(p: (A) => Boolean): RichTextCodec[A]
Attempts to validate a decoded value, or fails using the specified failure message.
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def |[B](that: => RichTextCodec[B]): RichTextCodec[Either[A, B]]
Returns a new codec that is the fallback composition of this codec and the specified codec, preferring this codec, but falling back to the specified codec in the event of failure.
- final def ~[B](that: => RichTextCodec[B])(implicit combiner: Combiner[A, B]): RichTextCodec[Out]
Returns a new codec that is the sequential composition of this codec and the specified codec, producing the values of both as a tuple.
- final def ~>[B](that: => RichTextCodec[B])(implicit ev: =:=[A, Unit]): RichTextCodec[B]
Returns a new codec that is the sequential composition of this codec and the specified codec, but which only produces the value of that codec.