object Handler
- Alphabetic
- By Inheritance
- Handler
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Type Members
- final class ContraFlatMap[-R, +Err, -In, +Out, In1] extends AnyVal
- final class FromFunction[In] extends AnyVal
- final class FromFunctionExit[In] extends AnyVal
- final class FromFunctionHandler[In] extends AnyVal
- final class FromFunctionZIO[In] extends AnyVal
- implicit final class RequestHandlerSyntax[-R, +Err] extends HeaderModifierZIO[RequestHandler[R, Err]]
- implicit final class ResponseOutputSyntax[-R, +Err, -In] extends AnyVal
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 asInstanceOf[T0]: T0
- Definition Classes
- Any
- def attempt[Out](out: => Out): Handler[Any, Throwable, Any, Out]
Attempts to create a Handler that succeeds with the provided value, capturing all exceptions on it's way.
- def badRequest(message: String): Handler[Any, Nothing, Any, Response]
Creates a handler which always responds with a 400 status code.
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native() @HotSpotIntrinsicCandidate()
- def die(failure: => Throwable): Handler[Any, Nothing, Any, Nothing]
Returns a handler that dies with the specified
Throwable
.Returns a handler that dies with the specified
Throwable
. This method can be used for terminating an app because a defect has been detected in the code. Terminating a handler leads to aborting handling of an HTTP request and responding with 500 Internal Server Error. - def dieMessage(message: => String): Handler[Any, Nothing, Any, Nothing]
Returns an app that dies with a
RuntimeException
having the specified text message.Returns an app that dies with a
RuntimeException
having the specified text message. This method can be used for terminating a HTTP request because a defect has been detected in the code. - final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- def error(message: String): Handler[Any, Nothing, Any, Response]
Creates a handler that responds with 500 status code
- def error(error: HttpError): Handler[Any, Nothing, Any, Response]
Creates a handler with HttpError.
- def fail[Err](err: => Err): Handler[Any, Err, Any, Nothing]
Creates a Handler that always fails
- def failCause[Err](cause: => Cause[Err]): Handler[Any, Err, Any, Nothing]
- def forbidden(message: String): Handler[Any, Nothing, Any, Response]
Creates a handler that responds with 403 - Forbidden status code
- def fromBody(body: Body): Handler[Any, Nothing, Any, Response]
Creates a handler which always responds the provided data and a 200 status code
- def fromEither[Err, Out](either: Either[Err, Out]): Handler[Any, Err, Any, Out]
Lifts an
Either
into aHandler
alue. - def fromExit[Err, Out](exit: => Exit[Err, Out]): Handler[Any, Err, Any, Out]
- def fromFunction[In]: FromFunction[In]
Creates a Handler from a pure function
- def fromFunctionExit[In]: FromFunctionExit[In]
Creates a Handler from an pure function from A to HExit[R,E,B]
- def fromFunctionHandler[In]: FromFunctionHandler[In]
- def fromFunctionZIO[In]: FromFunctionZIO[In]
Creates a Handler from an effectful pure function
- def fromHttp[R, Err, In, Out](http: Http[R, Err, In, Out], default: Handler[R, Err, In, Out])(implicit trace: Trace): Handler[R, Err, In, Out]
- def fromStream[R](stream: ZStream[R, Throwable, Byte])(implicit trace: Trace): Handler[R, Throwable, Any, Response]
Creates a Handler that always succeeds with a 200 status code and the provided ZStream as the body
- def fromStream[R](stream: ZStream[R, Throwable, String], charset: Charset = HTTP_CHARSET)(implicit trace: Trace): Handler[R, Throwable, Any, Response]
Creates a Handler that always succeeds with a 200 status code and the provided ZStream as the body
- def fromZIO[R, Err, Out](zio: => ZIO[R, Err, Out]): Handler[R, Err, Any, Out]
Converts a ZIO to a Handler type
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- def getResource(path: String)(implicit trace: Trace): Handler[Any, Throwable, Any, java.net.URL]
Attempts to retrieve files from the classpath.
- def getResourceAsFile(path: String)(implicit trace: Trace): Handler[Any, Throwable, Any, File]
Attempts to retrieve files from the classpath.
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- def html(view: Html): Handler[Any, Nothing, Any, Response]
Creates a handler which always responds with the provided Html page.
- def identity[A]: Handler[Any, Nothing, A, A]
Creates a pass thru Handler instance
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- def methodNotAllowed(message: String): Handler[Any, Nothing, Any, Response]
Creates a handler which always responds with a 405 status code.
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def notFound: Handler[Any, Nothing, Request, Response]
Creates a handler that fails with a NotFound exception.
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- def ok: Handler[Any, Nothing, Any, Response]
Creates a handler which always responds with a 200 status code.
- def response(response: Response): Handler[Any, Nothing, Any, Response]
Creates a handler which always responds with the same value.
- def responseZIO[R, Err](getResponse: ZIO[R, Err, Response]): Handler[R, Err, Any, Response]
Converts a ZIO to a handler type
- def stackTrace(implicit trace: Trace): Handler[Any, Nothing, Any, StackTrace]
- def status(code: Status): Handler[Any, Nothing, Any, Response]
Creates a handler which always responds with the same status code and empty data.
- def succeed[Out](out: Out): Handler[Any, Nothing, Any, Out]
Creates a Handler that always returns the same response and never fails.
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def template(heading: CharSequence)(view: Html): Handler[Any, Nothing, Any, Response]
Creates a handler which responds with an Html page using the built-in template.
- def text(text: CharSequence): Handler[Any, Nothing, Any, Response]
Creates a handler which always responds with the same plain text.
- def timeout(duration: zio.Duration)(implicit trace: Trace): Handler[Any, Nothing, Any, Response]
Creates a handler that responds with a 408 status code after the provided time duration
- def toString(): String
- Definition Classes
- AnyRef → Any
- def tooLarge: Handler[Any, Nothing, Any, Response]
Creates a handler which always responds with a 413 status code.
- 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])