trait RouteDecoderModule extends AnyRef
Instead of using just String as path params, using the RouteDecoderModule
we can extract and converted params into a specific type also.
scala
Http.collect[Request] {
case GET -> !! / "user" / int(id) => Response.text("User id requested: ${id}")
case GET -> !! / "user" / name => Response.text("User name requested: ${name}")
}
If the request looks like GET /user/100 then it would match the first case.
This is because internally the id param can be decoded into an Int. If a
request of the form GET /user/zio is made, in that case the second case is
matched.
Linear Supertypes
Ordering
- Alphabetic
- By Inheritance
Inherited
- RouteDecoderModule
- AnyRef
- Any
- Hide All
- Show All
Visibility
- Public
- All
Type Members
- abstract class RouteDecode[A] extends AnyRef
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native() @HotSpotIntrinsicCandidate()
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @HotSpotIntrinsicCandidate()
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @HotSpotIntrinsicCandidate()
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @HotSpotIntrinsicCandidate()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @HotSpotIntrinsicCandidate()
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toString(): String
- Definition Classes
- AnyRef → Any
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
- object boolean extends RouteDecode[Boolean]
- object byte extends RouteDecode[Byte]
- object date extends RouteDecode[LocalDate]
- object double extends RouteDecode[Double]
- object float extends RouteDecode[Float]
- object int extends RouteDecode[Int]
- object long extends RouteDecode[Long]
- object short extends RouteDecode[Short]
- object time extends RouteDecode[LocalDateTime]
- object uuid extends RouteDecode[UUID]