Handler

zio.http.Handler
See theHandler companion object
sealed trait Handler[-R, +Err, -In, +Out]

Attributes

Companion
object
Source
Handler.scala
Graph
Supertypes
class Object
trait Matchable
class Any
Self type
Handler[R, Err, In, Out]

Members list

Value members

Abstract methods

def apply(in: In): ZIO[Scope & R, Err, Out]

Consumes the input and executes the Handler.

Consumes the input and executes the Handler.

Attributes

Source
Handler.scala

Concrete methods

final def *>[R1 <: R, Err1 >: Err, In1 <: In, Out1](that: Handler[R1, Err1, In1, Out1])(implicit trace: Trace): Handler[R1, Err1, In1, Out1]

Alias for zipRight

Alias for zipRight

Attributes

Source
Handler.scala
final def <*[R1 <: R, Err1 >: Err, In1 <: In, Out1](that: Handler[R1, Err1, In1, Out1])(implicit trace: Trace): Handler[R1, Err1, In1, Out]

Alias for zipLeft

Alias for zipLeft

Attributes

Source
Handler.scala
final def <*>[R1 <: R, Err1 >: Err, In1 <: In, Out1](that: Handler[R1, Err1, In1, Out1])(implicit trace: Trace): Handler[R1, Err1, In1, (Out, Out1)]

Attributes

Source
Handler.scala
final def <<<[R1 <: R, Err1 >: Err, In1, Out1 <: In](that: Handler[R1, Err1, In1, Out1])(implicit trace: Trace): Handler[R1, Err1, In1, Out]

Composes one handler with another.

Composes one handler with another.

Attributes

Source
Handler.scala
final def <>[R1 <: R, Err1, In1 <: In, Out1 >: Out](that: Handler[R1, Err1, In1, Out1])(implicit trace: Trace): Handler[R1, Err1, In1, Out1]

Runs self but if it fails, runs other, ignoring the result from self.

Runs self but if it fails, runs other, ignoring the result from self.

Attributes

Source
Handler.scala
final def >>=[R1 <: R, Err1 >: Err, In1 <: In, Out1](f: Out => Handler[R1, Err1, In1, Out1])(implicit trace: Trace): Handler[R1, Err1, In1, Out1]

Alias for flatmap

Alias for flatmap

Attributes

Source
Handler.scala
final def >>>[R1 <: R, Err1 >: Err, In1 >: Out, Out1](that: Handler[R1, Err1, In1, Out1])(implicit trace: Trace): Handler[R1, Err1, In, Out1]

Pipes the output of one handler into the other

Pipes the output of one handler into the other

Attributes

Source
Handler.scala
def @@[Env1 <: R, In1 <: In](aspect: HandlerAspect[Env1, Unit])(implicit in: IsRequest[In1], out: Out <:< Response, err: Err <:< Response): Handler[Env1, Response, Request, Response]

Attributes

Source
Handler.scala
def @@[Env0, Ctx <: R, In1 <: In](aspect: HandlerAspect[Env0, Ctx])(implicit in: IsRequest[In1], out: Out <:< Response, err: Err <:< Response, trace: Trace, tag: Tag[Ctx]): Handler[Env0, Response, Request, Response]

Attributes

Source
Handler.scala
def @@[Env0]: ApplyContextAspect[R, Err, In, Out, Env0]

Attributes

Source
Handler.scala
final def absolve[Err1 >: Err, Out1](implicit ev: Out <:< Either[Err1, Out1], trace: Trace): Handler[R, Err1, In, Out1]

Returns a handler that submerges the error case of an Either into the Handler. The inverse operation of Handler.either.

Returns a handler that submerges the error case of an Either into the Handler. The inverse operation of Handler.either.

Attributes

Source
Handler.scala
final def andThen[R1 <: R, Err1 >: Err, In1 >: Out, Out1](that: Handler[R1, Err1, In1, Out1])(implicit trace: Trace): Handler[R1, Err1, In, Out1]

Named alias for >>>

Named alias for >>>

Attributes

Source
Handler.scala
final def as[Out1](out: Out1)(implicit trace: Trace): Handler[R, Err, In, Out1]

Makes the handler resolve with a constant value

Makes the handler resolve with a constant value

Attributes

Source
Handler.scala
final def asEnvType[R2](implicit ev: R2 <:< R): Handler[R2, Err, In, Out]

Attributes

Source
Handler.scala
final def asErrorType[Err2](implicit ev: Err <:< Err2): Handler[R, Err2, In, Out]

Attributes

Source
Handler.scala
final def asInType[In2](implicit ev: In2 <:< In): Handler[R, Err, In2, Out]

Attributes

Source
Handler.scala
final def asOutType[Out2](implicit ev: Out <:< Out2): Handler[R, Err, In, Out2]

Attributes

Source
Handler.scala
def body(implicit trace: Trace): Handler[R, Err, In, Body]
Implicitly added by ResponseOutputSyntax

Extracts body

Extracts body

Attributes

Source
Handler.scala
final def body(implicit ev: Out <:< Response, trace: Trace): Handler[R, Err, In, Body]

Attributes

Source
Handler.scala
final def catchAll[R1 <: R, Err1, In1 <: In, Out1 >: Out](f: Err => Handler[R1, Err1, In1, Out1])(implicit trace: Trace): Handler[R1, Err1, In1, Out1]

Catches all the exceptions that the handler can fail with

Catches all the exceptions that the handler can fail with

Attributes

Source
Handler.scala
final def catchAllCause[R1 <: R, Err1, In1 <: In, Out1 >: Out](f: (Cause[Err]) => Handler[R1, Err1, In1, Out1])(implicit trace: Trace): Handler[R1, Err1, In1, Out1]

Attributes

Source
Handler.scala
final def catchAllDefect[R1 <: R, Err1 >: Err, In1 <: In, Out1 >: Out](f: Throwable => Handler[R1, Err1, In1, Out1])(implicit trace: Trace): Handler[R1, Err1, In1, Out1]

Recovers from all defects with provided function.

Recovers from all defects with provided function.

'''WARNING''': There is no sensible way to recover from defects. This method should be used only at the boundary between Handler and an external system, to transmit information on a defect for diagnostic or explanatory purposes.

Attributes

Source
Handler.scala
final def catchSome[R1 <: R, Err1 >: Err, In1 <: In, Out1 >: Out](pf: PartialFunction[Err, Handler[R1, Err1, In1, Out1]])(implicit trace: Trace): Handler[R1, Err1, In1, Out1]

Recovers from some or all of the error cases.

Recovers from some or all of the error cases.

Attributes

Source
Handler.scala
final def catchSomeDefect[R1 <: R, Err1 >: Err, In1 <: In, Out1 >: Out](pf: PartialFunction[Throwable, Handler[R1, Err1, In1, Out1]])(implicit trace: Trace): Handler[R1, Err1, In1, Out1]

Recovers from some or all of the defects with provided partial function.

Recovers from some or all of the defects with provided partial function.

'''WARNING''': There is no sensible way to recover from defects. This method should be used only at the boundary between Handler and an external system, to transmit information on a defect for diagnostic or explanatory purposes.

Attributes

Source
Handler.scala
final def compose[R1 <: R, Err1 >: Err, In1, Out1 <: In](that: Handler[R1, Err1, In1, Out1])(implicit trace: Trace): Handler[R1, Err1, In1, Out]

Named alias for <<<

Named alias for <<<

Attributes

Source
Handler.scala
def contentLength(implicit trace: Trace): Handler[R, Err, In, Option[ContentLength]]
Implicitly added by ResponseOutputSyntax

Extracts content-length from the response if available

Extracts content-length from the response if available

Attributes

Source
Handler.scala
def contentType(implicit trace: Trace): Handler[R, Err, In, Option[ContentType]]
Implicitly added by ResponseOutputSyntax

Extracts the value of ContentType header

Extracts the value of ContentType header

Attributes

Source
Handler.scala
final def contraFlatMap[In1]: ContraFlatMap[R, Err, In, Out, In1]

Transforms the input of the handler before passing it on to the current Handler

Transforms the input of the handler before passing it on to the current Handler

Attributes

Source
Handler.scala
final def contramap[In1](f: In1 => In): Handler[R, Err, In1, Out]

Transforms the input of the handler before passing it on to the current Handler

Transforms the input of the handler before passing it on to the current Handler

Attributes

Source
Handler.scala
final def contramapZIO[R1 <: R, Err1 >: Err, In1](f: In1 => ZIO[R1, Err1, In])(implicit trace: Trace): Handler[R1, Err1, In1, Out]

Transforms the input of the handler before giving it effectfully

Transforms the input of the handler before giving it effectfully

Attributes

Source
Handler.scala
final def delay(duration: Duration)(implicit trace: Trace): Handler[R, Err, In, Out]

Delays production of output B for the specified duration of time

Delays production of output B for the specified duration of time

Attributes

Source
Handler.scala
final def delayAfter(duration: Duration)(implicit trace: Trace): Handler[R, Err, In, Out]

Delays production of output B for the specified duration of time

Delays production of output B for the specified duration of time

Attributes

Source
Handler.scala
final def delayBefore(duration: Duration)(implicit trace: Trace): Handler[R, Err, In, Out]

Delays consumption of input A for the specified duration of time

Delays consumption of input A for the specified duration of time

Attributes

Source
Handler.scala
final def either(implicit ev: CanFail[Err], trace: Trace): Handler[R, Nothing, In, Either[Err, Out]]

Returns a handler whose failure and success have been lifted into an Either. The resulting handler cannot fail, because the failure case has been exposed as part of the Either success case.

Returns a handler whose failure and success have been lifted into an Either. The resulting handler cannot fail, because the failure case has been exposed as part of the Either success case.

Attributes

Source
Handler.scala
final def flatMap[R1 <: R, Err1 >: Err, In1 <: In, Out1](f: Out => Handler[R1, Err1, In1, Out1])(implicit trace: Trace): Handler[R1, Err1, In1, Out1]

Creates a new handler from another

Creates a new handler from another

Attributes

Source
Handler.scala
final def flatten[R1 <: R, Err1 >: Err, In1 <: In, Out1](implicit ev: Out <:< Handler[R1, Err1, In1, Out1], trace: Trace): Handler[R1, Err1, In1, Out1]

Flattens a handler of a handler

Flattens a handler of a handler

Attributes

Source
Handler.scala
final def foldCauseHandler[R1 <: R, Err1, In1 <: In, Out1](onFailure: (Cause[Err]) => Handler[R1, Err1, In1, Out1], onSuccess: Out => Handler[R1, Err1, In1, Out1])(implicit trace: Trace): Handler[R1, Err1, In1, Out1]

Attributes

Source
Handler.scala
final def foldHandler[R1 <: R, Err1, In1 <: In, Out1](onFailure: Err => Handler[R1, Err1, In1, Out1], onSuccess: Out => Handler[R1, Err1, In1, Out1])(implicit trace: Trace): Handler[R1, Err1, In1, Out1]

Folds over the handler by taking in two functions one for success and one for failure respectively.

Folds over the handler by taking in two functions one for success and one for failure respectively.

Attributes

Source
Handler.scala
def header(headerType: HeaderType)(implicit trace: Trace): Handler[R, Err, In, Option[headerType.HeaderValue]]
Implicitly added by ResponseOutputSyntax

Extracts the value of the provided header name.

Extracts the value of the provided header name.

Attributes

Source
Handler.scala
final def header(headerType: HeaderType)(implicit ev: Out <:< Response, trace: Trace): Handler[R, Err, In, Option[headerType.HeaderValue]]

Attributes

Source
Handler.scala
def headerOrFail(headerType: HeaderType)(implicit trace: Trace, ev: Err <:< String): Handler[R, String, In, Option[headerType.HeaderValue]]
Implicitly added by ResponseOutputSyntax

Attributes

Source
Handler.scala
def headers(implicit trace: Trace): Handler[R, Err, In, Headers]
Implicitly added by ResponseOutputSyntax

Extracts the Headers from the type B if possible

Extracts the Headers from the type B if possible

Attributes

Source
Handler.scala
final def headers(implicit ev: Out <:< Response, trace: Trace): Handler[R, Err, In, Headers]

Attributes

Source
Handler.scala
final def map[Out1](f: Out => Out1)(implicit trace: Trace): Handler[R, Err, In, Out1]

Transforms the output of the handler

Transforms the output of the handler

Attributes

Source
Handler.scala
final def mapError[Err1](f: Err => Err1)(implicit trace: Trace): Handler[R, Err1, In, Out]

Transforms the failure of the handler

Transforms the failure of the handler

Attributes

Source
Handler.scala
final def mapErrorCause[Err2](f: (Cause[Err]) => Err2)(implicit trace: Trace): Handler[R, Err2, In, Out]

Transforms all failures except pure interruption.

Transforms all failures except pure interruption.

Attributes

Source
Handler.scala
final def mapErrorCauseZIO[R1 <: R, Err1, Out1 >: Out](f: (Cause[Err]) => ZIO[R1, Err1, Out1])(implicit trace: Trace): Handler[R1, Err1, In, Out1]

Transforms all failures of the handler effectfully except pure interruption.

Transforms all failures of the handler effectfully except pure interruption.

Attributes

Source
Handler.scala
final def mapErrorZIO[R1 <: R, Err1, Out1 >: Out](f: Err => ZIO[R1, Err1, Out1])(implicit trace: Trace): Handler[R1, Err1, In, Out1]

Transforms the failure of the handler effectfully

Transforms the failure of the handler effectfully

Attributes

Source
Handler.scala
final def mapZIO[R1 <: R, Err1 >: Err, Out1](f: Out => ZIO[R1, Err1, Out1])(implicit trace: Trace): Handler[R1, Err1, In, Out1]

Transforms the output of the handler effectfully

Transforms the output of the handler effectfully

Attributes

Source
Handler.scala
final def merge[Err1 >: Err, Out1 >: Out](implicit ev: Err1 =:= Out1, trace: Trace): Handler[R, Nothing, In, Out1]

Returns a new handler where the error channel has been merged into the success channel to their common combined type.

Returns a new handler where the error channel has been merged into the success channel to their common combined type.

Attributes

Source
Handler.scala
final def narrow[In1](implicit ev: In1 <:< In): Handler[R, Err, In1, Out]

Narrows the type of the input

Narrows the type of the input

Attributes

Source
Handler.scala
final def onExit[R1 <: R, Err1 >: Err](f: (Exit[Err, Out]) => ZIO[R1, Err1, Any])(implicit trace: Trace): Handler[R1, Err1, In, Out]

Attributes

Source
Handler.scala
final def option(implicit ev: CanFail[Err], trace: Trace): Handler[R, Nothing, In, Option[Out]]

Executes this handler, skipping the error but returning optionally the success.

Executes this handler, skipping the error but returning optionally the success.

Attributes

Source
Handler.scala
final def optional[Err1](implicit ev: Err <:< Option[Err1], trace: Trace): Handler[R, Err1, In, Option[Out]]

Converts an option on errors into an option on values.

Converts an option on errors into an option on values.

Attributes

Source
Handler.scala
final def orDie(implicit ev1: Err <:< Throwable, ev2: CanFail[Err], trace: Trace): Handler[R, Nothing, In, Out]

Translates handler failure into death of the handler, making all failures unchecked and not a part of the type of the handler.

Translates handler failure into death of the handler, making all failures unchecked and not a part of the type of the handler.

Attributes

Source
Handler.scala
final def orDieWith(f: Err => Throwable)(implicit ev: CanFail[Err], trace: Trace): Handler[R, Nothing, In, Out]

Keeps none of the errors, and terminates the handler with them, using the specified function to convert the E into a Throwable.

Keeps none of the errors, and terminates the handler with them, using the specified function to convert the E into a Throwable.

Attributes

Source
Handler.scala
final def orElse[R1 <: R, Err1, In1 <: In, Out1 >: Out](that: Handler[R1, Err1, In1, Out1])(implicit trace: Trace): Handler[R1, Err1, In1, Out1]

Named alias for <>

Named alias for <>

Attributes

Source
Handler.scala
final def provideEnvironment(r: ZEnvironment[R])(implicit trace: Trace): Handler[Any, Err, In, Out]

Provides the environment to Handler.

Provides the environment to Handler.

Attributes

Source
Handler.scala
final def provideLayer[Err1 >: Err, R0](layer: ZLayer[R0, Err1, R])(implicit trace: Trace): Handler[R0, Err1, In, Out]

Provides layer to Handler.

Provides layer to Handler.

Attributes

Source
Handler.scala
final def provideSomeEnvironment[R1](f: (ZEnvironment[R1]) => ZEnvironment[R])(implicit trace: Trace): Handler[R1, Err, In, Out]

Provides some of the environment to Handler.

Provides some of the environment to Handler.

Attributes

Source
Handler.scala
final def provideSomeLayer[R0, R1 : Tag, Err1 >: Err](layer: ZLayer[R0, Err1, R1])(implicit evidence$1: Tag[R1], ev: (R0 & R1) <:< R, trace: Trace): Handler[R0, Err1, In, Out]

Provides some of the environment to Handler leaving the remainder R0.

Provides some of the environment to Handler leaving the remainder R0.

Attributes

Source
Handler.scala
final def race[R1 <: R, Err1 >: Err, In1 <: In, Out1 >: Out](that: Handler[R1, Err1, In1, Out1])(implicit trace: Trace): Handler[R1, Err1, In1, Out1]

Performs a race between two handlers

Performs a race between two handlers

Attributes

Source
Handler.scala
def rawHeader(name: CharSequence)(implicit trace: Trace): Handler[R, Err, In, Option[String]]
Implicitly added by ResponseOutputSyntax

Attributes

Source
Handler.scala
final def refineOrDie[Err1](pf: PartialFunction[Err, Err1])(implicit ev1: Err <:< Throwable, ev2: CanFail[Err], trace: Trace): Handler[R, Err1, In, Out]

Keeps some of the errors, and terminates the handler with the rest.

Keeps some of the errors, and terminates the handler with the rest.

Attributes

Source
Handler.scala
final def refineOrDieWith[Err1](pf: PartialFunction[Err, Err1])(f: Err => Throwable)(implicit ev: CanFail[Err], trace: Trace): Handler[R, Err1, In, Out]

Keeps some of the errors, and terminates the handler with the rest, using the specified function to convert the E into a Throwable.

Keeps some of the errors, and terminates the handler with the rest, using the specified function to convert the E into a Throwable.

Attributes

Source
Handler.scala
final def run(method: Method = ..., path: Path = ..., headers: Headers = ..., body: Body = ...)(implicit ev: Request <:< In): ZIO[Scope & R, Err, Out]

Attributes

Source
Handler.scala
final def runZIO(in: In): ZIO[Scope & R, Err, Out]

Attributes

Source
Handler.scala
final def sandbox(implicit trace: Trace): Handler[R, Response, In, Out]

Attributes

Source
Handler.scala
def status(implicit trace: Trace): Handler[R, Err, In, Status]
Implicitly added by ResponseOutputSyntax

Extracts Status from the type B is possible.

Extracts Status from the type B is possible.

Attributes

Source
Handler.scala
final def status(implicit ev: Out <:< Response, trace: Trace): Handler[R, Err, In, Status]

Attributes

Source
Handler.scala
final def tapAllZIO[R1 <: R, Err1 >: Err](onFailure: (Cause[Err]) => ZIO[R1, Err1, Any], onSuccess: Out => ZIO[R1, Err1, Any])(implicit trace: Trace): Handler[R1, Err1, In, Out]

Returns a Handler that effectfully peeks at the success, failed or defective value of this Handler.

Returns a Handler that effectfully peeks at the success, failed or defective value of this Handler.

Attributes

Source
Handler.scala
final def tapErrorCauseZIO[R1 <: R, Err1 >: Err](f: (Cause[Err]) => ZIO[R1, Err1, Any])(implicit trace: Trace): Handler[R1, Err1, In, Out]

Attributes

Source
Handler.scala
final def tapErrorZIO[R1 <: R, Err1 >: Err](f: Err => ZIO[R1, Err1, Any])(implicit trace: Trace): Handler[R1, Err1, In, Out]

Returns a Handler that effectfully peeks at the failure of this Handler.

Returns a Handler that effectfully peeks at the failure of this Handler.

Attributes

Source
Handler.scala
final def tapZIO[R1 <: R, Err1 >: Err](f: Out => ZIO[R1, Err1, Any])(implicit trace: Trace): Handler[R1, Err1, In, Out]

Returns a Handler that effectfully peeks at the success of this Handler.

Returns a Handler that effectfully peeks at the success of this Handler.

Attributes

Source
Handler.scala
def timeout(duration: Duration)(implicit trace: Trace): Handler[R, Err, In, Option[Out]]

Attributes

Source
Handler.scala
def timeoutFail[Out1 >: Out](out: Out1)(duration: Duration)(implicit trace: Trace): Handler[R, Err, In, Out1]

Attributes

Source
Handler.scala
def toRoutes(implicit in: Request <:< In, out: Out <:< Response, trace: Trace): Routes[R, Err]

Converts the request handler into an HTTP application. Note that the handler of the HTTP application is not identical to this handler, because the handler has been appropriately sandboxed, turning all possible failures into well-formed HTTP responses.

Converts the request handler into an HTTP application. Note that the handler of the HTTP application is not identical to this handler, because the handler has been appropriately sandboxed, turning all possible failures into well-formed HTTP responses.

Attributes

Source
Handler.scala
final def unrefine[Err1 >: Err](pf: PartialFunction[Throwable, Err1])(implicit trace: Trace): Handler[R, Err1, In, Out]

Takes some defects and converts them into failures.

Takes some defects and converts them into failures.

Attributes

Source
Handler.scala
final def unrefineTo[Err1 >: Err : ClassTag](implicit evidence$1: ClassTag[Err1], trace: Trace): Handler[R, Err1, In, Out]

Takes some defects and converts them into failures.

Takes some defects and converts them into failures.

Attributes

Source
Handler.scala
final def unrefineWith[Err1](pf: PartialFunction[Throwable, Err1])(f: Err => Err1)(implicit trace: Trace): Handler[R, Err1, In, Out]

Takes some defects and converts them into failures, using the specified function to convert the E into an E1.

Takes some defects and converts them into failures, using the specified function to convert the E into an E1.

Attributes

Source
Handler.scala
final def unwrapZIO[R1 <: R, Err1 >: Err, Out1](implicit ev: Out <:< ZIO[R1, Err1, Out1], trace: Trace): Handler[R1, Err1, In, Out1]

Unwraps a Handler that returns a ZIO of Http

Unwraps a Handler that returns a ZIO of Http

Attributes

Source
Handler.scala
def widen[Err1, Out1](implicit ev1: Err <:< Err1, ev2: Out <:< Out1): Handler[R, Err1, In, Out1]

Widens the type of the output

Widens the type of the output

Attributes

Source
Handler.scala
final def zip[R1 <: R, Err1 >: Err, In1 <: In, Out1](that: Handler[R1, Err1, In1, Out1])(implicit trace: Trace): Handler[R1, Err1, In1, (Out, Out1)]

Attributes

Source
Handler.scala
final def zipLeft[R1 <: R, Err1 >: Err, In1 <: In, Out1](that: Handler[R1, Err1, In1, Out1])(implicit trace: Trace): Handler[R1, Err1, In1, Out]

Attributes

Source
Handler.scala
final def zipRight[R1 <: R, Err1 >: Err, In1 <: In, Out1](that: Handler[R1, Err1, In1, Out1])(implicit trace: Trace): Handler[R1, Err1, In1, Out1]

Combines the two apps and returns the result of the one on the right

Combines the two apps and returns the result of the one on the right

Attributes

Source
Handler.scala

Concrete fields

val self: Handler[R, Err, In, Response]
Implicitly added by ResponseOutputSyntax

Attributes

Source
Handler.scala