sealed trait HttpCodec[-AtomTypes, Value] extends AnyRef

A zio.http.api.HttpCodec represents a codec for a part of an HTTP request. HttpCodec the HTTP protocol, these parts may be the unconsumed portion of the HTTP path (a route codec), the query string parameters (a query codec), the request headers (a header codec), or the request body (a body codec).

A HttpCodec is a purely declarative description of an input, and therefore, it can be used to generate documentation, clients, and client libraries.

HttpCodecs are a bit like invertible multi-channel parsers.

Self Type
HttpCodec[AtomTypes, Value]
Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. HttpCodec
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##: Int
    Definition Classes
    AnyRef → Any
  3. final def &[Value2](that: QueryCodec[Value2])(implicit combiner: Combiner[Value, Value2], ev: <:<[Query, AtomTypes]): QueryCodec[Out]

    Combines two query codecs into another query codec.

  4. final def ++[AtomTypes1 <: AtomTypes, Value2](that: HttpCodec[AtomTypes1, Value2])(implicit combiner: Combiner[Value, Value2]): HttpCodec[AtomTypes1, Out]

    Returns a new codec that is the composition of this codec and the specified codec.

    Returns a new codec that is the composition of this codec and the specified codec. For codecs that include route codecs, the routes will be decoded sequentially from left to right.

  5. final def /[Value2](that: RouteCodec[Value2])(implicit combiner: Combiner[Value, Value2], ev: <:<[Route, AtomTypes]): RouteCodec[Out]

    Combines two route codecs into another route codec.

  6. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  7. final def ??(doc: Doc): HttpCodec[AtomTypes, Value]

    Returns a new codec that is the same as this one, but has attached docs, which will render whenever docs are generated from the codec.

  8. final def alternatives: Chunk[HttpCodec[AtomTypes, Value]]

    Produces a flattened collection of alternatives.

    Produces a flattened collection of alternatives. Once flattened, each codec inside the returned collection is guaranteed to contain no nested alternatives.

  9. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  10. final def asQuery(implicit ev: <:<[Query, AtomTypes]): QueryCodec[Value]

    Reinterprets this codec as a query codec assuming evidence that this interpretation is sound.

  11. final def asRoute(implicit ev: <:<[Route, AtomTypes]): RouteCodec[Value]

    Reinterpets this codec as a route codec assuming evidence that this interpretation is sound.

  12. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @native() @HotSpotIntrinsicCandidate()
  13. final def decodeRequest(request: Request)(implicit trace: Trace): Task[Value]

    Uses this codec to decode the Scala value from a request.

  14. final def decodeResponse(response: Response)(implicit trace: Trace): Task[Value]

    Uses this codec to decode the Scala value from a response.

  15. final def encodeRequest(value: Value): Request

    Uses this codec to encode the Scala value into a request.

  16. final def encodeResponse[Z](value: Value): Response

    Uses this codec to encode the Scala value as a response.

  17. final def encodeResponsePatch[Z](value: Value): Response.Patch

    Uses this codec to encode the Scala value as a response patch.

  18. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  19. def equals(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef → Any
  20. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  21. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  22. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  23. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  24. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  25. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  26. final def optional: HttpCodec[AtomTypes, Option[Value]]

    Returns a new codec, where the value produced by this one is optional.

  27. final def orElseEither[AtomTypes1 <: AtomTypes, Value2](that: HttpCodec[AtomTypes1, Value2]): HttpCodec[AtomTypes1, Either[Value, Value2]]
  28. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  29. final def toLeft[R]: HttpCodec[AtomTypes, Either[Value, R]]
  30. final def toRight[L]: HttpCodec[AtomTypes, Either[L, Value]]
  31. def toString(): String
    Definition Classes
    AnyRef → Any
  32. final def transform[Value2](f: (Value) => Value2, g: (Value2) => Value): HttpCodec[AtomTypes, Value2]

    Transforms the type parameter of this HttpCodec from Value to Value2.

    Transforms the type parameter of this HttpCodec from Value to Value2. Due to the fact that HttpCodec is invariant in its type parameter, the transformation requires not just a function from Value to Value2, but also, a function from Value2 to Value.

    One of these functions will be used in decoding, for example, when the endpoint is invoked on the server. The other of these functions will be used in encoding, for example, when a client calls the endpoint on the server.

  33. final def transformOrFail[Value2](f: (Value) => Either[String, Value2], g: (Value2) => Either[String, Value]): HttpCodec[AtomTypes, Value2]
  34. final def transformOrFailLeft[Value2](f: (Value) => Either[String, Value2], g: (Value2) => Value): HttpCodec[AtomTypes, Value2]
  35. final def transformOrFailRight[Value2](f: (Value) => Value2, g: (Value2) => Either[String, Value]): HttpCodec[AtomTypes, Value2]
  36. final def unit(canonical: Value): HttpCodec[AtomTypes, Unit]

    Transforms the type parameter to Unit by specifying that all possible values that can be decoded from this HttpCodec are in fact equivalent to the provided canonical value.

    Transforms the type parameter to Unit by specifying that all possible values that can be decoded from this HttpCodec are in fact equivalent to the provided canonical value.

    Note: You should NOT use this method on any codec which can decode semantically distinct values.

  37. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  38. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()
  39. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  40. final def |[AtomTypes1 <: AtomTypes, Value2](that: HttpCodec[AtomTypes1, Value2]): HttpCodec[AtomTypes1, Either[Value, Value2]]

Deprecated Value Members

  1. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable]) @Deprecated
    Deprecated

Inherited from AnyRef

Inherited from Any

Ungrouped