型パラメータ
型パラメータ
def post: Action[Request] =
Action.async(DtoParser.parse[Request]) { implicit request =>
final def async[A](bodyParser: BodyParser[A])(block: R[A] => Future[Result]): Action[A] = composeAction(new Action[A] {
def executionContext = self.executionContext
def parser = composeParser(bodyParser)
def apply(request: Request[A]) = try {
invokeBlock(request, block)
} catch {
// NotImplementedError is not caught by NonFatal, wrap it
case e: NotImplementedError => throw new RuntimeException(e)
// LinkageError is similarly harmless in Play Framework, since automatic reloading could easily trigger it
case e: LinkageError => throw new RuntimeException(e)
}
})
def 関数名[型パラメータ,……](引数名:引数の型名,……):返り値 = 関数本体
型パラメータA = [Request]で
こういう
bodyParser:BodyParser[A] = DtoParser.parse[Request]
block: R[A] => Future[Result] = { implicit request => ~~}
blockは無名関数としてasyncに渡されてるかな
https://www.atmarkit.co.jp/ait/articles/1204/05/news126_2.html