sealed trait Route[-Env, +Err] extends AnyRef
- Self Type
- Route[Env, Err]
- Alphabetic
- By Inheritance
- Route
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Abstract Value Members
- abstract def location: Trace
The location where the route was created, which is useful for debugging purposes.
- abstract def routePattern: RoutePattern[_]
The route pattern over which the route is defined.
The route pattern over which the route is defined. The route can only handle requests that match this route pattern.
- abstract def toHandler(implicit ev: <:<[Err, Response], trace: Trace): Handler[Env, Response, Request, Response]
Concrete Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def apply(request: Request)(implicit ev: <:<[Err, Response], trace: Trace): ZIO[Env, Response, Response]
Applies the route to the specified request.
Applies the route to the specified request. The route must be defined for the request, or else this method will fail fatally. Note that you may only call this function when you have handled all errors produced by the route, converting them into responses.
- def asErrorType[Err2](implicit ev: <:<[Err, Err2]): Route[Env, Err2]
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @IntrinsicCandidate() @native()
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @IntrinsicCandidate() @native()
- final def handleError(f: (Err) => Response)(implicit trace: Trace): Route[Env, Nothing]
Handles all typed errors in the route by converting them into responses.
Handles all typed errors in the route by converting them into responses. This method can be used to convert a route that does not handle its errors into one that does handle its errors.
- final def handleErrorCause(f: (Cause[Err]) => Response)(implicit trace: Trace): Route[Env, Nothing]
Handles all typed errors, as well as all non-recoverable errors, by converting them into responses.
Handles all typed errors, as well as all non-recoverable errors, by converting them into responses. This method can be used to convert a route that does not handle its errors into one that does handle its errors.
- final def handleErrorCauseZIO(f: (Cause[Err]) => ZIO[Any, Nothing, Response])(implicit trace: Trace): Route[Env, Nothing]
Handles all typed errors, as well as all non-recoverable errors, by converting them into a ZIO effect that produces the response.
Handles all typed errors, as well as all non-recoverable errors, by converting them into a ZIO effect that produces the response. This method can be used to convert a route that does not handle its errors into one that does handle its errors.
- final def handleErrorRequest(f: (Err, Request) => Response)(implicit trace: Trace): Route[Env, Nothing]
Handles all typed errors in the route by converting them into responses, taking into account the request that caused the error.
Handles all typed errors in the route by converting them into responses, taking into account the request that caused the error. This method can be used to convert a route that does not handle its errors into one that does handle its errors.
- final def handleErrorRequestCause(f: (Request, Cause[Err]) => Response)(implicit trace: Trace): Route[Env, Nothing]
Handles all typed errors, as well as all non-recoverable errors, by converting them into responses, taking into account the request that caused the error.
Handles all typed errors, as well as all non-recoverable errors, by converting them into responses, taking into account the request that caused the error. This method can be used to convert a route that does not handle its errors into one that does handle its errors.
- final def handleErrorRequestCauseZIO(f: (Request, Cause[Err]) => ZIO[Any, Nothing, Response])(implicit trace: Trace): Route[Env, Nothing]
Handles all typed errors, as well as all non-recoverable errors, by converting them into a ZIO effect that produces the response, taking into account the request that caused the error.
Handles all typed errors, as well as all non-recoverable errors, by converting them into a ZIO effect that produces the response, taking into account the request that caused the error. This method can be used to convert a route that does not handle its errors into one that does handle its errors.
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @IntrinsicCandidate() @native()
- final def isDefinedAt(request: Request): Boolean
Determines if the route is defined for the specified request.
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- final def mapError[Err1](fxn: (Err) => Err1)(implicit trace: Trace): Route[Env, Err1]
Allows the transformation of the Err type through a function allowing one to build up a Routes in Stages targets the Unhandled case
- final def mapErrorZIO[Err1](fxn: (Err) => ZIO[Any, Err1, Response])(implicit trace: Trace): Route[Env, Err1]
Allows the transformation of the Err type through an Effectful program allowing one to build up a Routes in Stages targets the Unhandled case only.
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def nest(prefix: PathCodec[Unit])(implicit ev: <:<[Err, Response]): Route[Env, Err]
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @IntrinsicCandidate() @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @IntrinsicCandidate() @native()
- final def provideEnvironment(env: ZEnvironment[Env]): Route[Any, Err]
- final def run(request: Request)(implicit trace: Trace): ZIO[Env, Either[Err, Response], Response]
Applies the route to the specified request.
Applies the route to the specified request. The route must be defined for the request, or else this method will fail fatally.
- final def sandbox(implicit trace: Trace): Route[Env, Nothing]
Returns a route that automatically translates all failures into responses, using best-effort heuristics to determine the appropriate HTTP status code, and attaching error details using the HTTP header
Warning. - final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- final def toHttpApp(implicit ev: <:<[Err, Response]): HttpApp[Env]
- def toString(): String
- Definition Classes
- AnyRef → Any
- def transform[Env1](f: (Handler[Env, Response, Request, Response]) => Handler[Env1, Response, Request, Response]): Route[Env1, Err]
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])