A pattern for matching routes that examines both HTTP method and path. In addition to specifying a method, patterns contain segment patterns, which are sequences of literals, integers, longs, and other segment types.
Typically, your entry point constructor for a route pattern would be zio.http.Method:
import zio.http.Method
import zio.http.codec.SegmentCodec._
val pattern = Method.GET / "users" / int("user-id") / "posts" / string("post-id")
However, you can use the convenience constructors in RoutePattern
, such as RoutePattern.GET
.
Attributes
- Companion
- object
- Graph
-
- Supertypes
-
trait Serializabletrait Producttrait Equalsclass Objecttrait Matchableclass AnyShow all
- Self type
-
RoutePattern[A]
Members list
Value members
Concrete methods
Creates a route from this pattern and the specified handler.
Creates a route from this pattern and the specified handler.
Attributes
Creates a route from this pattern and the specified handler, which ignores any parameters produced by this route pattern. This method exists for performance reasons, as it avoids all overhead of propagating parameters or supporting contextual middleware.
Creates a route from this pattern and the specified handler, which ignores any parameters produced by this route pattern. This method exists for performance reasons, as it avoids all overhead of propagating parameters or supporting contextual middleware.
Attributes
Combines this route pattern with the specified middleware, which can be used to build a route by providing a handler.
Combines this route pattern with the specified middleware, which can be used to build a route by providing a handler.
Attributes
Returns a new pattern that is extended with the specified segment pattern.
Returns a new pattern that is extended with the specified segment pattern.
Attributes
Attaches documentation to the route pattern, which may be used when generating developer docs for a route.
Attaches documentation to the route pattern, which may be used when generating developer docs for a route.
Attributes
Reinteprets the type parameter, given evidence it is equal to some other type.
Reinteprets the type parameter, given evidence it is equal to some other type.
Attributes
Decodes a method and path into a value of type A
.
Decodes a method and path into a value of type A
.
Attributes
Returns the documentation for the route pattern, if any.
Returns the documentation for the route pattern, if any.
Attributes
Encodes a value of type A
into the method and path that this route pattern would successfully match against.
Encodes a value of type A
into the method and path that this route pattern would successfully match against.
Attributes
Formats a value of type A
into a path. This is useful for embedding paths into HTML that is rendered by the server.
Formats a value of type A
into a path. This is useful for embedding paths into HTML that is rendered by the server.
Attributes
Determines if this pattern matches the specified method and path. Rather than use this method, you should just try to decode it directly, for higher performance, otherwise the same information will be decoded twice.
Determines if this pattern matches the specified method and path. Rather than use this method, you should just try to decode it directly, for higher performance, otherwise the same information will be decoded twice.
Attributes
Renders the route pattern as a string.
Renders the route pattern as a string.
Attributes
Converts the route pattern into an HttpCodec that produces the same value.
Converts the route pattern into an HttpCodec that produces the same value.
Attributes
Returns a string representation of the object.
Returns a string representation of the object.
The default representation is platform dependent.
Attributes
- Returns
-
a string representation of the object.
- Definition Classes
-
Any
This exists for use with Scala custom extractor syntax, allowing route patterns to match against and deconstruct tuples of methods and paths.
This exists for use with Scala custom extractor syntax, allowing route patterns to match against and deconstruct tuples of methods and paths.
Attributes
Inherited methods
Attributes
- Inherited from:
- Product
Attributes
- Inherited from:
- Product