TextCodec

zio.http.codec.TextCodec
See theTextCodec companion object
sealed trait TextCodec[A] extends PartialFunction[String, A]

A zio.http.codec.TextCodec defines a codec for a text fragment. The text fragment can be decoded into a value, or the value can be encoded into a text fragment.

Unlike parsers, text codecs operate on entire fragments. They do not consume input and leave remainders. Also unlike parsers, text codecs do not fail with error messages, but rather, simply return None if they do not succeed in decoding from a given text fragment. Finally, unlike ordinary parsers, text codecs are fully invertible, and can therefore be used in client generation.

Attributes

Companion:
object
Graph
Supertypes
trait String => A
class Object
trait Matchable
class Any
Known subtypes
object BooleanCodec.type
class Constant
object IntCodec.type
object StringCodec.type
object UUIDCodec.type
Self type

Members list

Concise view

Value members

Abstract methods

def apply(value: String): A
def encode(value: A): String

Concrete methods

final def decode(value: String): Option[A]

Inherited methods

Attributes

Inherited from:
PartialFunction
override def andThen[C](k: A => C): PartialFunction[A, C]

Attributes

Definition Classes
Inherited from:
PartialFunction
def applyOrElse[A1 <: String, B1 >: A](x: A1, default: A1 => B1): B1

Attributes

Inherited from:
PartialFunction

Attributes

Inherited from:
PartialFunction
def compose[A](g: A => String): A => R

Attributes

Inherited from:
Function1

Attributes

Inherited from:
PartialFunction
def lift: A => Option[B]

Attributes

Inherited from:
PartialFunction

Attributes

Inherited from:
PartialFunction
def runWith[U](action: A => U): A => Boolean

Attributes

Inherited from:
PartialFunction
override def toString(): String

Returns a string representation of the object.

Returns a string representation of the object.

The default representation is platform dependent.

Attributes

Returns:

a string representation of the object.

Definition Classes
Function1 -> Any
Inherited from:
Function1

Attributes

Inherited from:
PartialFunction