RouteTree

zio.blocks.endpoint.RouteTree
See theRouteTree companion object
final case class RouteTree[A](roots: Map[Method, SegmentSubtree[A]])

Routing trie keyed by HTTP method, then by path segments. Literals are matched first, then dynamic segments in priority order (int > long > uuid > bool > string > combined > trailing). HEAD requests fall back to GET handlers. Merge prefers right-hand-side values on conflict.

Trailing fallback: when the path segments are exhausted at a level with no exact value, lookup falls through to a Trailing branch below that level — so a trailing route also matches its own prefix path (a /assets/... route matches /assets), and it shadows a missing exact match at that level. This is intentional (a trailing route is a prefix catch-all by design): register exact routes alongside trailing ones when both must coexist. Literals are still tried first at every level that has segments left, and per-branch matching itself never allocates (see SegmentCodec.matches).

Attributes

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

Members list

Value members

Concrete methods

def add[A1 >: A](pattern: RoutePattern[_], value: A1): RouteTree[A1]

Attributes

Source
RouteTree.scala
def get(method: Method, path: Path): Option[A]

Attributes

Source
RouteTree.scala
def map[B](f: A => B): RouteTree[B]

Attributes

Source
RouteTree.scala
def merge[A1 >: A](that: RouteTree[A1]): RouteTree[A1]

Attributes

Source
RouteTree.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