SegmentSubtree

zio.blocks.endpoint.SegmentSubtree
See theSegmentSubtree companion object
final case class SegmentSubtree[A](literals: Map[String, SegmentSubtree[A]], others: ListMap[Key, (SegmentCodec[_], SegmentSubtree[A])], value: Option[A])

A single level of the routing trie. literals holds exact-match branches, others holds dynamic segment branches keyed by SegmentCodec.Key and ordered by match priority.

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 get(segments: Chunk[String], index: Int): Option[A]

Looks up segments from index. Literals win over dynamic branches at every level; an exhausted path falls back to a Trailing branch below (see RouteTree). Each dynamic branch is probed with the allocation-free SegmentCodec.matches — the match-then-decode double parse this implies is accepted deliberately (trie probing runs per branch, the handler decodes the matched path once).

Looks up segments from index. Literals win over dynamic branches at every level; an exhausted path falls back to a Trailing branch below (see RouteTree). Each dynamic branch is probed with the allocation-free SegmentCodec.matches — the match-then-decode double parse this implies is accepted deliberately (trie probing runs per branch, the handler decodes the matched path once).

Attributes

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

Attributes

Source
RouteTree.scala
def merge[A1 >: A](that: SegmentSubtree[A1]): SegmentSubtree[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