A zio.http.HandlerAspect is a kind of zio.http.ProtocolStack that is specialized to transform a handler's incoming requests and outgoing responses. Each layer in the stack corresponds to a separate transformation.
Layers may incorporate layer-specific information into a generic type parameter, referred to as middleware context, which composes using tupling.
Layers may also be stateful at the level of each transformation application. So, for example, a layer that is timing request durations may capture the start time of the request in the incoming interceptor, and pass this state to the outgoing interceptor, which can then compute the duration.
zio.http.HandlerAspect is more than just a wrapper around zio.http.ProtocolStack, as its concatenation operator has been specialized to entuple contexts, so that each layer may only add context to the contextual output.
Attributes
- Companion
- object
- Source
- HandlerAspect.scala
- Graph
-
- Supertypes
-
trait Serializabletrait Producttrait Equalstrait Middleware[Env]class Objecttrait Matchableclass AnyShow all
- Self type
-
Members list
Value members
Concrete methods
Combines this middleware with the specified middleware sequentially, such that this middleware will be applied first on incoming requests, and last on outgoing responses, and the specified middleware will be applied last on incoming requests, and first on outgoing responses. Context from both middleware will be combined using tuples.
Combines this middleware with the specified middleware sequentially, such that this middleware will be applied first on incoming requests, and last on outgoing responses, and the specified middleware will be applied last on incoming requests, and first on outgoing responses. Context from both middleware will be combined using tuples.
Attributes
- Source
- HandlerAspect.scala
Applies middleware to the specified handler, which may ignore the context produced by this middleware.
Applies middleware to the specified handler, which may ignore the context produced by this middleware.
Attributes
- Definition Classes
- Source
- HandlerAspect.scala
Attributes
- Source
- HandlerAspect.scala
Applies middleware to the specified handler, which must process the context produced by this middleware.
Applies middleware to the specified handler, which must process the context produced by this middleware.
Attributes
- Source
- HandlerAspect.scala
Returns new middleware that transforms the context of the middleware to the specified constant.
Returns new middleware that transforms the context of the middleware to the specified constant.
Attributes
- Source
- HandlerAspect.scala
Returns new middleware that transforms the context of the middleware using the specified function.
Returns new middleware that transforms the context of the middleware using the specified function.
Attributes
- Source
- HandlerAspect.scala
Returns new middleware that fully provides the specified environment to this middleware, resulting in middleware that has no contextual dependencies.
Returns new middleware that fully provides the specified environment to this middleware, resulting in middleware that has no contextual dependencies.
Attributes
- Source
- HandlerAspect.scala
Returns new middleware that produces the unit value as its context.
Returns new middleware that produces the unit value as its context.
Attributes
- Source
- HandlerAspect.scala
Conditionally applies this middleware to the specified handler, based on the result of the predicate applied to the incoming request.
Conditionally applies this middleware to the specified handler, based on the result of the predicate applied to the incoming request.
Attributes
- Source
- HandlerAspect.scala
Conditionally applies this middleware to the specified handler, based on the result of the predicate applied to the incoming request's headers.
Conditionally applies this middleware to the specified handler, based on the result of the predicate applied to the incoming request's headers.
Attributes
- Source
- HandlerAspect.scala
Conditionally applies this middleware to the specified handler, based on the result of the effectful predicate applied to the incoming request.
Conditionally applies this middleware to the specified handler, based on the result of the effectful predicate applied to the incoming request.
Attributes
- Source
- HandlerAspect.scala
Inherited methods
Attributes
- Inherited from:
- Middleware
- Source
- Middleware.scala
Attributes
- Inherited from:
- Middleware
- Source
- Middleware.scala
Attributes
- Inherited from:
- Product
Attributes
- Inherited from:
- Product