Literal
Attributes
- Source
- SegmentCodec.scala
- Graph
-
- Supertypes
-
trait Serializabletrait Producttrait Equalstrait SegmentCodec[Unit]class Objecttrait Matchableclass AnyShow all
Members list
Type members
Types
Phantom capture marker: SegmentCodec.NoPathVars when this segment captures nothing (empty and literal segments), SegmentCodec.HasPathVars when it captures a value (bool, int, long, string, UUID, trailing, and any composition containing one of those). This is a second, parallel type track: it never affects A (the runtime-decoded value type) and has zero runtime footprint. Its only consumer is PathCodec.orElse, which requires both branches to be NoPathVars so a capturing codec mapped to Unit is rejected at the call site instead of failing expand at runtime.
Phantom capture marker: SegmentCodec.NoPathVars when this segment captures nothing (empty and literal segments), SegmentCodec.HasPathVars when it captures a value (bool, int, long, string, UUID, trailing, and any composition containing one of those). This is a second, parallel type track: it never affects A (the runtime-decoded value type) and has zero runtime footprint. Its only consumer is PathCodec.orElse, which requires both branches to be NoPathVars so a capturing codec mapped to Unit is rejected at the call site instead of failing expand at runtime.
Attributes
- Source
- SegmentCodec.scala
Value members
Inherited methods
Attributes
- Inherited from:
- SegmentCodec
- Source
- SegmentCodec.scala
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
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
Attributes
- Inherited from:
- SegmentCodec
- Source
- SegmentCodec.scala
Maps the decoded segment value into a domain type, lifting into a PathCodec.
Maps the decoded segment value into a domain type, lifting into a PathCodec.
Example: SegmentCodec.string("id").transform(CustomerId(_), _.value)
Value parameters
- decode
-
maps the decoded segment value into the exposed type
- encode
-
maps the exposed type back into the original segment representation used by
format
Attributes
- Returns
-
a path codec with the transformed value type and the same route shape as
self - Inherited from:
- SegmentCodec
- Source
- SegmentCodec.scala
Effectfully maps the decoded segment value into a domain type, lifting into a PathCodec. decode returning Left causes path decoding / matching to fail; encode returning Left is propagated as the Left result of format.
Effectfully maps the decoded segment value into a domain type, lifting into a PathCodec. decode returning Left causes path decoding / matching to fail; encode returning Left is propagated as the Left result of format.
Example: SegmentCodec.string("id").transformOrFail(CustomerId.parse, id => Right(id.value))
Attributes
- Inherited from:
- SegmentCodec
- Source
- SegmentCodec.scala
Composes a physical segment with a literal suffix (for example string("word") ~ "!"). The literal is validated exactly like SegmentCodec.literal (empty, /-carrying, or encoding-requiring values are rejected with IllegalArgumentException).
Composes a physical segment with a literal suffix (for example string("word") ~ "!"). The literal is validated exactly like SegmentCodec.literal (empty, /-carrying, or encoding-requiring values are rejected with IllegalArgumentException).
Attributes
- Inherited from:
- SegmentCodec
- Source
- SegmentCodec.scala
Composes two physical segments into one (for example int("n") ~ literal("-") ~ string("rest")).
Composes two physical segments into one (for example int("n") ~ literal("-") ~ string("rest")).
Adjacent string ~ string, numeric ~ numeric (Int/Long in any order, including through a flattened combined tail), and anything involving Trailing are rejected at runtime with IllegalArgumentException (ambiguous splits); put a literal, bool, or UUID segment between them.
The result's PathVars is the logical OR of both sides (computed by the pathVarsCombiner implicit, which defaults conservatively to HasPathVars when either side's marker is unknown), so orElse keeps rejecting compositions that capture.
Attributes
- Inherited from:
- SegmentCodec
- Source
- SegmentCodec.scala