HeaderCodec

zio.http.schema.HeaderCodec
See theHeaderCodec companion object
abstract class HeaderCodec[A] extends Codec[Headers, HeadersBuilder, A]

A codec for encoding a value of type A into zio.http.Headers and decoding zio.http.Headers back into A.

Instances are typically derived via HeaderFormat using the schema derivation framework.

Attributes

Companion
object
Source
HeaderCodec.scala
Graph
Supertypes
class Object
trait Matchable
class Any

Members list

Value members

Concrete methods

final def encodeToHeaders(value: A): Headers

Attributes

Source
HeaderCodec.scala

Inherited and Abstract methods

def decode(input: Headers): Either[SchemaError, A]

Decodes the specified input into a value of the target type.

Decodes the specified input into a value of the target type.

Value parameters

input

The input data that needs to be decoded.

Attributes

Returns

Either a SchemaError indicating the decoding failure, or a decoded value.

Inherited from:
Codec
Source
Codec.scala
def encode(value: A, output: HeadersBuilder): Unit

Encodes the given value into the specified output representation.

Encodes the given value into the specified output representation.

Value parameters

output

The target output into which the value will be encoded.

value

The value to be encoded.

Attributes

Returns

This method does not return a value.

Inherited from:
Codec
Source
Codec.scala