Interface RouteDirectives
- All Known Subinterfaces:
Directives
- All Known Implementing Classes:
Directives$
,HttpApp
,RouteDirectives$
-
Method Summary
Modifier and TypeMethodDescription<T> StandardRoute
complete
(StatusCode status, scala.collection.immutable.Seq<HttpHeader> headers, scala.Function0<T> v, Marshaller<T, RequestEntity> m) Completes the request using the given arguments.<T> StandardRoute
complete
(StatusCode status, scala.Function0<T> v, Marshaller<T, RequestEntity> m) Completes the request using the given arguments.complete
(scala.Function0<ToResponseMarshallable> m) Completes the request using the given arguments.Bubbles the given error up the response chain, where it is dealt with by the closesthandleExceptions
directive and its ExceptionHandler.handle
(scala.Function1<HttpRequest, scala.concurrent.Future<HttpResponse>> handler) Handle the request using a function.handle
(scala.PartialFunction<HttpRequest, scala.concurrent.Future<HttpResponse>> handler) Handle the request using an asynchronous partial function.handle
(scala.PartialFunction<HttpRequest, scala.concurrent.Future<HttpResponse>> handler, scala.collection.immutable.Seq<Rejection> rejections) Handle the request using an asynchronous partial function.handleSync
(scala.Function1<HttpRequest, HttpResponse> handler) Handle the request using a function.handleSync
(scala.PartialFunction<HttpRequest, HttpResponse> handler) Handle the request using a synchronous partial function.handleSync
(scala.PartialFunction<HttpRequest, HttpResponse> handler, scala.collection.immutable.Seq<Rejection> rejections) Handle the request using a synchronous partial function.redirect
(Uri uri, StatusCodes.Redirection redirectionType) Completes the request with redirection response of the given type to the given URI.reject()
Rejects the request with an empty set of rejections.Rejects the request with the given rejections.
-
Method Details
-
reject
StandardRoute reject()Rejects the request with an empty set of rejections.- Returns:
- (undocumented)
-
reject
Rejects the request with the given rejections.- Parameters:
rejections
- (undocumented)- Returns:
- (undocumented)
-
redirect
Completes the request with redirection response of the given type to the given URI.- Parameters:
uri
- (undocumented)redirectionType
- (undocumented)- Returns:
- (undocumented)
-
complete
Completes the request using the given arguments.- Parameters:
m
- (undocumented)- Returns:
- (undocumented)
-
complete
Completes the request using the given arguments.- Parameters:
status
- (undocumented)v
- (undocumented)m
- (undocumented)- Returns:
- (undocumented)
-
complete
<T> StandardRoute complete(StatusCode status, scala.collection.immutable.Seq<HttpHeader> headers, scala.Function0<T> v, Marshaller<T, RequestEntity> m) Completes the request using the given arguments.- Parameters:
status
- (undocumented)headers
- (undocumented)v
- (undocumented)m
- (undocumented)- Returns:
- (undocumented)
-
failWith
Bubbles the given error up the response chain, where it is dealt with by the closesthandleExceptions
directive and its ExceptionHandler.- Parameters:
error
- (undocumented)- Returns:
- (undocumented)
-
handle
Handle the request using a function.- Parameters:
handler
- (undocumented)- Returns:
- (undocumented)
-
handleSync
Handle the request using a function.- Parameters:
handler
- (undocumented)- Returns:
- (undocumented)
-
handle
StandardRoute handle(scala.PartialFunction<HttpRequest, scala.concurrent.Future<HttpResponse>> handler) Handle the request using an asynchronous partial function.This directive can be used to include external components request processing components defined as PartialFunction (like those provided by akka-grpc) into a routing tree defined as routes.
When the partial function is not defined for a request, the request is rejected with an empty list of rejections which is equivalent to a "Not Found" rejection.
- Parameters:
handler
- (undocumented)- Returns:
- (undocumented)
-
handle
StandardRoute handle(scala.PartialFunction<HttpRequest, scala.concurrent.Future<HttpResponse>> handler, scala.collection.immutable.Seq<Rejection> rejections) Handle the request using an asynchronous partial function.This directive can be used to include external components request processing components defined as PartialFunction (like those provided by akka-grpc) into a routing tree defined as routes.
- Parameters:
rejections
- The list of rejections to reject with if the handler is not defined for a request.handler
- (undocumented)- Returns:
- (undocumented)
-
handleSync
Handle the request using a synchronous partial function.This directive can be used to include external components request processing components defined as PartialFunction (like those provided by akka-grpc) into a routing tree defined as routes.
When the partial function is not defined for a request, the request is rejected with an empty list of rejections which is equivalent to a "Not Found" rejection.
- Parameters:
handler
- (undocumented)- Returns:
- (undocumented)
-
handleSync
StandardRoute handleSync(scala.PartialFunction<HttpRequest, HttpResponse> handler, scala.collection.immutable.Seq<Rejection> rejections) Handle the request using a synchronous partial function.This directive can be used to include external components request processing components defined as PartialFunction (like those provided by akka-grpc) into a routing tree defined as routes.
- Parameters:
rejections
- The list of rejections to reject with if the handler is not defined for a request.handler
- (undocumented)- Returns:
- (undocumented)
-