Handler

zio.http.Handler
See theHandler companion trait

Attributes

Companion
trait
Source
Handler.scala
Graph
Supertypes
class Object
trait Matchable
class Any
Self type
Handler.type

Members list

Type members

Classlikes

final class ContraFlatMap[-R, +Err, -In, +Out, In1](val self: Handler[R, Err, In, Out]) extends AnyVal

Attributes

Source
Handler.scala
Supertypes
class AnyVal
trait Matchable
class Any
final class FromFunction[In](val self: Unit) extends AnyVal

Attributes

Source
Handler.scala
Supertypes
class AnyVal
trait Matchable
class Any
final class FromFunctionEither[In](val self: Unit) extends AnyVal

Attributes

Source
Handler.scala
Supertypes
class AnyVal
trait Matchable
class Any
final class FromFunctionExit[In](val self: Unit) extends AnyVal

Attributes

Source
Handler.scala
Supertypes
class AnyVal
trait Matchable
class Any
final class FromFunctionHandler[In](val self: Unit) extends AnyVal

Attributes

Source
Handler.scala
Supertypes
class AnyVal
trait Matchable
class Any
final class FromFunctionZIO[In](val self: Unit) extends AnyVal

Attributes

Source
Handler.scala
Supertypes
class AnyVal
trait Matchable
class Any
object IsRequest

Attributes

Companion
trait
Source
Handler.scala
Supertypes
class Object
trait Matchable
class Any
Self type
IsRequest.type
sealed trait IsRequest[-A]

Attributes

Companion
object
Source
Handler.scala
Supertypes
class Object
trait Matchable
class Any
final class ParamExtractorBuilder[A](val unit: Unit) extends AnyVal

Attributes

Source
Handler.scala
Supertypes
class AnyVal
trait Matchable
class Any
final implicit class RequestHandlerSyntax[-R, +Err](val self: RequestHandler[R, Err]) extends HeaderModifier[RequestHandler[R, Err]]

Attributes

Source
Handler.scala
Supertypes
class Object
trait Matchable
class Any
final implicit class ResponseOutputSyntax[-R, +Err, -In](val self: Handler[R, Err, In, Response]) extends AnyVal

Attributes

Source
Handler.scala
Supertypes
class AnyVal
trait Matchable
class Any
final class ScopedPartiallyApplied[R](dummy: Boolean = ...) extends AnyVal

Attributes

Source
Handler.scala
Supertypes
class AnyVal
trait Matchable
class Any

Value members

Concrete methods

def asChunkBounded(request: Request, limit: Int)(implicit trace: Trace): Handler[Any, Throwable, Any, Chunk[Byte]]

Attributes

Source
Handler.scala
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.

Attempts to create a Handler that succeeds with the provided value, capturing all exceptions on it's way.

Attributes

Source
Handler.scala
def badRequest(message: => String): Handler[Any, Nothing, Any, Response]

Creates a handler which always responds with a 400 status code.

Creates a handler which always responds with a 400 status code.

Attributes

Source
Handler.scala
def die(failure: => Throwable): Handler[Any, Nothing, Any, Nothing]

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.

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.

Attributes

Source
Handler.scala
def dieMessage(message: => String): Handler[Any, Nothing, Any, Nothing]

Returns an handler 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.

Returns an handler 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.

Attributes

Source
Handler.scala
def error(status: => Error): Handler[Any, Nothing, Any, Response]

Creates a handler with an error and the default error message.

Creates a handler with an error and the default error message.

Attributes

Source
Handler.scala
def error(status: => Error, message: => String): Handler[Any, Nothing, Any, Response]

Creates a handler with an error and the specified error message. The error message will be returned as HTML, JSON or plain text depending on the Accept header of the request, defaulting to ErrorResponseConfig.errorFormat. If ErrorResponseConfig.withErrorBody is false, the error message will not be included in the response. If the error message should always be included in the response, use Handler.fromResponse(Response.error(status, message))

Creates a handler with an error and the specified error message. The error message will be returned as HTML, JSON or plain text depending on the Accept header of the request, defaulting to ErrorResponseConfig.errorFormat. If ErrorResponseConfig.withErrorBody is false, the error message will not be included in the response. If the error message should always be included in the response, use Handler.fromResponse(Response.error(status, message))

Attributes

Source
Handler.scala
def error(status: => Error, message: => String, routes: Routes[_, _]): Handler[Any, Nothing, Any, Response]

Creates a handler with an error and the specified error message. The error message will be returned as HTML, JSON or plain text depending on the Accept header of the request, defaulting to ErrorResponseConfig.errorFormat. If ErrorResponseConfig.withErrorBody is false, the error message will not be included in the response. If the error message should always be included in the response, use Handler.fromResponse(Response.error(status, message))

Creates a handler with an error and the specified error message. The error message will be returned as HTML, JSON or plain text depending on the Accept header of the request, defaulting to ErrorResponseConfig.errorFormat. If ErrorResponseConfig.withErrorBody is false, the error message will not be included in the response. If the error message should always be included in the response, use Handler.fromResponse(Response.error(status, message))

Attributes

Source
Handler.scala
def fail[Err](err: => Err): Handler[Any, Err, Any, Nothing]

Creates a Handler that always fails

Creates a Handler that always fails

Attributes

Source
Handler.scala
def failCause[Err](cause: => Cause[Err]): Handler[Any, Err, Any, Nothing]

Attributes

Source
Handler.scala
def firstSuccessOf[R, Err, In, Out](handlers: NonEmptyChunk[Handler[R, Err, In, Out]], isRecoverable: (Cause[Err]) => Boolean = ...)(implicit trace: Trace): Handler[R, Err, In, Out]

Attributes

Source
Handler.scala
def forbidden: Handler[Any, Nothing, Any, Response]

Creates a handler that responds with 403 - Forbidden status code

Creates a handler that responds with 403 - Forbidden status code

Attributes

Source
Handler.scala
def forbidden(message: => String): Handler[Any, Nothing, Any, Response]

Creates a handler that responds with 403 - Forbidden status code

Creates a handler that responds with 403 - Forbidden status code

Attributes

Source
Handler.scala
def from[H](handler: => H)(implicit h: ToHandler[H]): Handler[h.Env, h.Err, h.In, h.Out]

Attributes

Source
Handler.scala
def fromBody(body: => Body): Handler[Any, Nothing, Any, Response]

Creates a handler which always responds the provided data and a 200 status code

Creates a handler which always responds the provided data and a 200 status code

Attributes

Source
Handler.scala
def fromEither[Err, Out](either: => Either[Err, Out]): Handler[Any, Err, Any, Out]

Lifts an Either into a Handler alue.

Lifts an Either into a Handler alue.

Attributes

Source
Handler.scala
def fromExit[Err, Out](exit: => Exit[Err, Out]): Handler[Any, Err, Any, Out]

Attributes

Source
Handler.scala
def fromFile[R](makeFile: => File, charset: Charset = ...)(implicit trace: Trace): Handler[R, Throwable, Request, Response]

Attributes

Source
Handler.scala
def fromFileZIO[R](getFile: ZIO[R, Throwable, File], charset: Charset = ...)(implicit trace: Trace): Handler[R, Throwable, Request, Response]

Attributes

Source
Handler.scala
def fromFunction[In]: FromFunction[In]

Creates a Handler from a pure function

Creates a Handler from a pure function

Attributes

Source
Handler.scala

Creates a Handler from an pure function from A to Either[E,B]

Creates a Handler from an pure function from A to Either[E,B]

Attributes

Source
Handler.scala

Creates a Handler from an pure function from A to HExit[R,E,B]

Creates a Handler from an pure function from A to HExit[R,E,B]

Attributes

Source
Handler.scala

Attributes

Source
Handler.scala

Creates a Handler from an effectful pure function

Creates a Handler from an effectful pure function

Attributes

Source
Handler.scala
def fromResponse(response: => Response): Handler[Any, Nothing, Any, Response]

Creates a handler which always responds with the same value.

Creates a handler which always responds with the same value.

Attributes

Source
Handler.scala
def fromResponseZIO[R, Err](getResponse: ZIO[R, Err, Response]): Handler[R, Err, Any, Response]

Converts a ZIO to a handler type

Converts a ZIO to a handler type

Attributes

Source
Handler.scala
def fromStream[R](stream: ZStream[R, Throwable, String], contentLength: Long, charset: Charset = ...)(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

Creates a Handler that always succeeds with a 200 status code and the provided ZStream with a known content length as the body

Attributes

Source
Handler.scala
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

Creates a Handler that always succeeds with a 200 status code and the provided ZStream with a known content length as the body

Attributes

Source
Handler.scala
def fromStreamChunked[R](stream: ZStream[R, Throwable, String], charset: 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 using chunked transfer encoding

Creates a Handler that always succeeds with a 200 status code and the provided ZStream as the body using chunked transfer encoding

Attributes

Source
Handler.scala
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

Creates a Handler that always succeeds with a 200 status code and the provided ZStream as the body using chunked transfer encoding

Attributes

Source
Handler.scala
def fromZIO[R, Err, Out](zio: => ZIO[R, Err, Out]): Handler[R, Err, Any, Out]

Converts a ZIO to a Handler type

Converts a ZIO to a Handler type

Attributes

Source
Handler.scala
def html(view: => Html): Handler[Any, Nothing, Any, Response]

Creates a handler which always responds with the provided Html page.

Creates a handler which always responds with the provided Html page.

Attributes

Source
Handler.scala
def identity[A]: Handler[Any, Nothing, A, A]

Creates a pass thru Handler instance

Creates a pass thru Handler instance

Attributes

Source
Handler.scala
def internalServerError: Handler[Any, Nothing, Any, Response]

Attributes

Source
Handler.scala
def internalServerError(message: => String): Handler[Any, Nothing, Any, Response]

Attributes

Source
Handler.scala
def methodNotAllowed: Handler[Any, Nothing, Any, Response]

Creates a handler which always responds with a 405 status code.

Creates a handler which always responds with a 405 status code.

Attributes

Source
Handler.scala
def methodNotAllowed(message: => String): Handler[Any, Nothing, Any, Response]

Creates a handler which always responds with a 405 status code.

Creates a handler which always responds with a 405 status code.

Attributes

Source
Handler.scala
def notFound(message: => String): Handler[Any, Nothing, Any, Response]

Attributes

Source
Handler.scala
def notFound(routes: Routes[_, _]): Handler[Any, Nothing, Request, Response]

Attributes

Source
Handler.scala

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.

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.

Attributes

Source
Handler.scala

Attributes

Source
Handler.scala
def stackTrace(implicit trace: Trace): Handler[Any, Nothing, Any, StackTrace]

Attributes

Source
Handler.scala
def status(code: => Status): Handler[Any, Nothing, Any, Response]

Creates a handler which always responds with the same status code and empty data.

Creates a handler which always responds with the same status code and empty data.

Attributes

Source
Handler.scala
def succeed[Out](out: => Out): Handler[Any, Nothing, Any, Out]

Creates a Handler that always returns the same response and never fails.

Creates a Handler that always returns the same response and never fails.

Attributes

Source
Handler.scala
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.

Creates a handler which responds with an Html page using the built-in template.

Attributes

Source
Handler.scala
def text(text: => CharSequence): Handler[Any, Nothing, Any, Response]

Creates a handler which always responds with the same plain text.

Creates a handler which always responds with the same plain text.

Attributes

Source
Handler.scala
def timeout(duration: Duration)(implicit trace: Trace): Handler[Any, Nothing, Any, Response]

Creates a handler that responds with a 408 status code after the provided time duration

Creates a handler that responds with a 408 status code after the provided time duration

Attributes

Source
Handler.scala
final def webSocket[Env](f: WebSocketChannel => ZIO[Env, Throwable, Any]): WebSocketApp[Env]

Constructs a handler from a function that uses a web socket.

Constructs a handler from a function that uses a web socket.

Attributes

Source
Handler.scala

Inherited methods

def fromResource(path: String, charset: Charset = ...)(implicit trace: Trace): Handler[Any, Throwable, Request, Response]

Creates a handler from a resource path. For file:// resources, Range requests are fully supported. For jar:// resources, Range requests are not supported (returns Accept-Ranges: none).

Creates a handler from a resource path. For file:// resources, Range requests are fully supported. For jar:// resources, Range requests are not supported (returns Accept-Ranges: none).

Attributes

Inherited from:
HandlerPlatformSpecific
Source
HandlerPlatformSpecific.scala
def getResource(path: String)(implicit trace: Trace): Handler[Any, Throwable, Any, URL]

Attempts to retrieve files from the classpath.

Attempts to retrieve files from the classpath.

Attributes

Inherited from:
HandlerPlatformSpecific
Source
HandlerPlatformSpecific.scala
def getResourceAsFile(path: String)(implicit trace: Trace): Handler[Any, Throwable, Any, File]

Attempts to retrieve files from the classpath.

Attempts to retrieve files from the classpath.

Attributes

Inherited from:
HandlerPlatformSpecific
Source
HandlerPlatformSpecific.scala

Concrete fields

val badRequest: Handler[Any, Nothing, Any, Response]

Creates a handler which always responds with a 400 status code.

Creates a handler which always responds with a 400 status code.

Attributes

Source
Handler.scala
val notFound: Handler[Any, Nothing, Request, Response]

Creates a handler that fails with a NotFound exception.

Creates a handler that fails with a NotFound exception.

Attributes

Source
Handler.scala
val ok: Handler[Any, Nothing, Any, Response]

Creates a handler which always responds with a 200 status code.

Creates a handler which always responds with a 200 status code.

Attributes

Source
Handler.scala
val tooLarge: Handler[Any, Nothing, Any, Response]

Creates a handler which always responds with a 413 status code.

Creates a handler which always responds with a 413 status code.

Attributes

Source
Handler.scala
val unit: Handler[Any, Nothing, Any, Unit]

Attributes

Source
Handler.scala

Implicits

Implicits

final implicit def RequestHandlerSyntax[R, Err](self: RequestHandler[R, Err]): RequestHandlerSyntax[R, Err]

Attributes

Source
Handler.scala
final implicit def ResponseOutputSyntax[R, Err, In](self: Handler[R, Err, In, Response]): ResponseOutputSyntax[R, Err, In]

Attributes

Source
Handler.scala