Interface RouteDirectives

    • Method Detail

      • reject

        StandardRoute reject()
        Rejects the request with an empty set of rejections.

        Returns:
        (undocumented)
      • reject

        StandardRoute reject​(scala.collection.immutable.Seq<Rejection> rejections)
        Rejects the request with the given rejections.

        Parameters:
        rejections - (undocumented)
        Returns:
        (undocumented)
      • redirect

        StandardRoute redirect​(Uri uri,
                               StatusCodes.Redirection redirectionType)
        Completes the request with redirection response of the given type to the given URI.

        Parameters:
        uri - (undocumented)
        redirectionType - (undocumented)
        Returns:
        (undocumented)
      • complete

        StandardRoute complete​(scala.Function0<ToResponseMarshallable> m)
        Completes the request using the given arguments.

        Parameters:
        m - (undocumented)
        Returns:
        (undocumented)
      • complete

        <T> StandardRoute complete​(StatusCode status,
                                   scala.Function0<T> v,
                                   Marshaller<T,​RequestEntity> m)
        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

        StandardRoute failWith​(java.lang.Throwable error)
        Bubbles the given error up the response chain, where it is dealt with by the closest handleExceptions directive and its ExceptionHandler.

        Parameters:
        error - (undocumented)
        Returns:
        (undocumented)
      • handle

        StandardRoute handle​(scala.Function1<HttpRequest,​scala.concurrent.Future<HttpResponse>> handler)
        Handle the request using a function.

        Parameters:
        handler - (undocumented)
        Returns:
        (undocumented)
      • handleSync

        StandardRoute handleSync​(scala.Function1<HttpRequest,​HttpResponse> handler)
        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

        StandardRoute handleSync​(scala.PartialFunction<HttpRequest,​HttpResponse> handler)
        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)