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
- Source
- RoutePattern.scala
- Graph
-
- Supertypes
- Self type
-
RoutePattern[A]
Members list
Type members
Types
Attributes
- Source
- RoutePattern.scala
Value members
Concrete methods
Creates a route from this pattern and the specified handler.
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
- Source
- RoutePattern.scala
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
- Source
- RoutePattern.scala
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
- Source
- RoutePattern.scala
Attributes
- Source
- RoutePattern.scala
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
- Source
- RoutePattern.scala
Decodes a method and path into a value of type A.
Returns the documentation for the route pattern, if any.
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
- Source
- RoutePattern.scala
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
- Source
- RoutePattern.scala
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
- Source
- RoutePattern.scala
Attributes
- Source
- RoutePattern.scala
Renders the route pattern as a string.
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
- Source
- RoutePattern.scala
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
- Source
- RoutePattern.scala
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
- Source
- RoutePattern.scala