【发布时间】:2017-07-07 23:24:43
【问题描述】:
我正在查看这个 akka-http 文档示例(链接到 akka-http 测试代码):
这实际上是来自github代码MarshalSpec.scala的测试。我的问题是,这里导入的隐式 Marshaller 在哪里?我正在看进口,但我找不到它?我尝试使用 IntelliJ 向我展示隐式导入,但我仍然无法弄清楚这一点。获取传递给 Marshaller 的隐式声明的 import 语句在哪里:
val entityFuture = Marshal(string).to[MessageEntity]
在第 21 行? 它调用了
def to[B](implicit m: Marshaller[A, B], ec: ExecutionContext): Future[B] =
在 Marshal.scala 中并传递一个隐含的 m: Marshaller,我无法确定。
【问题讨论】: