handle

inline fun <T : Any> <ERROR CLASS>.handle(noinline body: suspend <ERROR CLASS><Unit, <ERROR CLASS>>.(T) -> Unit)

Registers a handler body for a resource defined by the T class.

Parameters

body

receives an instance of the typed resource T as the first parameter.


fun <T : Any> <ERROR CLASS>.handle(serializer: <ERROR CLASS><T>, body: suspend <ERROR CLASS><Unit, <ERROR CLASS>>.(T) -> Unit)

Registers a handler body for a resource defined by the T class.

Parameters

serializer

is used to decode the parameters of the request to an instance of the typed resource T.

body

receives an instance of the typed resource T as the first parameter.