RoutePattern

zio.blocks.endpoint.RoutePattern
See theRoutePattern companion object
final case class RoutePattern[A](method: Method, pathCodec: PathCodec[A], doc: Doc = ...)

HTTP method paired with a typed path pattern. The primary constructor is Method.GET / "users" / PathCodec.int("id"). Use alternatives to expand orElse branches, RoutePattern.any(Method) or RoutePattern.any for catch-all trailing routes, and nest to prepend a path prefix.

Attributes

Companion
object
Source
RoutePattern.scala
Graph
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

Members list

Value members

Concrete methods

def /[B, C](that: PathCodec[B])(implicit combiner: WithOut[A, B, C]): RoutePattern[C]
Implicitly added by RoutePatternOps

Attributes

Source
RoutePattern.scala
def alternatives: List[RoutePattern[A]]

Expands orElse branches and multi-method patterns into one pattern per (method, path) pair for routing-trie insertion. The fan-out is intentional — the trie is keyed by method first, so each method needs its own copy — and identical copies (for example a method listed twice) are removed.

Expands orElse branches and multi-method patterns into one pattern per (method, path) pair for routing-trie insertion. The fan-out is intentional — the trie is keyed by method first, so each method needs its own copy — and identical copies (for example a method listed twice) are removed.

Attributes

Source
RoutePattern.scala
def decode(actual: Method, path: Path): Either[String, A]

Attributes

Source
RoutePattern.scala
def encode(value: A): Either[String, (Method, Path)]

Attributes

Source
RoutePattern.scala
def format(value: A): Either[String, Path]

Attributes

Source
RoutePattern.scala
def matches(actual: Method, path: Path): Boolean

Boolean fast path: equivalent to decode(actual, path).isRight without building any decoded values or candidate lists (see PathCodecRuntime.matchesCodec).

Boolean fast path: equivalent to decode(actual, path).isRight without building any decoded values or candidate lists (see PathCodecRuntime.matchesCodec).

Attributes

Source
RoutePattern.scala
def nest(prefix: PathCodec[Unit]): RoutePattern[A]

Attributes

Source
RoutePattern.scala
def render: String

Attributes

Source
RoutePattern.scala

Inherited methods

def productElementNames: Iterator[String]

An iterator over the names of all the elements of this product.

An iterator over the names of all the elements of this product.

Attributes

Inherited from:
Product
Source
Product.scala
def productIterator: Iterator[Any]

An iterator over all the elements of this product.

An iterator over all the elements of this product.

Attributes

Returns

in the default implementation, an Iterator[Any]

Inherited from:
Product
Source
Product.scala