object Handler extends HandlerPlatformSpecific
- Alphabetic
- By Inheritance
- Handler
- HandlerPlatformSpecific
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
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
- sealed trait IsRequest[-A] extends AnyRef
- final class ParamExtractorBuilder[A] extends AnyVal
- implicit final class RequestHandlerSyntax[-R, +Err] extends HeaderModifier[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
- def asChunkBounded(request: Request, limit: Int)(implicit trace: Trace): Handler[Any, Throwable, Any, Chunk[Byte]]
-
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
badRequest: 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( ... ) @native() @IntrinsicCandidate()
-
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 handler 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 handler that dies with a
RuntimeExceptionhaving the specified text message.Returns an handler that dies with a
RuntimeExceptionhaving 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: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
error(status: ⇒ Error, message: ⇒ String): Handler[Any, Nothing, Any, Response]
Creates a handler with an error and the specified error message.
-
def
error(status: ⇒ Error): Handler[Any, Nothing, Any, Response]
Creates a handler with an error and the default error message.
-
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 firstSuccessOf[R, Err, In, Out](handlers: NonEmptyChunk[Handler[R, Err, In, Out]], isRecoverable: (Cause[Err]) ⇒ Boolean = (cause: Cause[Err]) => !cause.isDie)(implicit trace: Trace): Handler[R, Err, In, Out]
-
def
forbidden(message: ⇒ String): Handler[Any, Nothing, Any, Response]
Creates a handler that responds with 403 - Forbidden status code
-
def
forbidden: Handler[Any, Nothing, Any, Response]
Creates a handler that responds with 403 - Forbidden status code
- def from[H](handler: ⇒ H)(implicit h: ToHandler[H]): Handler[Env, Err, In, Out]
-
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
Eitherinto aHandleralue. - def fromExit[Err, Out](exit: ⇒ Exit[Err, Out]): Handler[Any, Err, Any, Out]
- def fromFile[R](makeFile: ⇒ File)(implicit trace: Trace): Handler[R, Throwable, Any, Response]
- def fromFileZIO[R](getFile: ZIO[R, Throwable, File])(implicit trace: Trace): Handler[R, Throwable, Any, Response]
-
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
fromResource(path: String)(implicit trace: Trace): Handler[Any, Throwable, Any, Response]
- Definition Classes
- HandlerPlatformSpecific
-
def
fromResponse(response: ⇒ Response): Handler[Any, Nothing, Any, Response]
Creates a handler which always responds with the same value.
-
def
fromResponseZIO[R, Err](getResponse: ZIO[R, Err, Response]): Handler[R, Err, Any, Response]
Converts a ZIO to a handler type
-
def
fromStream[R](stream: ZStream[R, Throwable, Byte], contentLength: Long)(implicit trace: Trace): Handler[R, Throwable, Any, Response]
Creates a Handler that always succeeds with a 200 status code and the provided ZStream with a known content length as the body
-
def
fromStream[R](stream: ZStream[R, Throwable, String], contentLength: Long, charset: Charset = Charsets.Http)(implicit trace: Trace): Handler[R, Throwable, Any, Response]
Creates a Handler that always succeeds with a 200 status code and the provided ZStream with a known content length as the body
-
def
fromStreamChunked[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 using chunked transfer encoding
-
def
fromStreamChunked[R](stream: ZStream[R, Throwable, String], charset: Charset = Charsets.Http)(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 using chunked transfer encoding
-
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[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @IntrinsicCandidate()
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @IntrinsicCandidate()
-
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
- def internalServerError(message: ⇒ String): Handler[Any, Nothing, Any, Response]
- def internalServerError: Handler[Any, Nothing, Any, Response]
-
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.
-
def
methodNotAllowed: 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(message: ⇒ String): Handler[Any, Nothing, Any, Response]
-
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() @IntrinsicCandidate()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @IntrinsicCandidate()
-
def
ok: Handler[Any, Nothing, Any, Response]
Creates a handler which always responds with a 200 status code.
-
def
param[A]: ParamExtractorBuilder[A]
Creates a builder that can be used to create a handler that projects some component from its input.
Creates a builder that can be used to create a handler that projects some component from its input. This is useful when created nested or monadic handlers, which require the input to all handlers be unified. By created extractors, the "smaller" handlers can extract what they need from the input to the "biggest" handler.
- 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.
- val unit: Handler[Any, Nothing, Any, Unit]
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
webSocket[Env](f: (WebSocketChannel) ⇒ ZIO[Env, Throwable, Any]): WebSocketApp[Env]
Constructs a handler from a function that uses a web socket.
- object IsRequest