val graph: Source[String, Future[IOResult]]= <some flow>
到
val graph: Source[ByteString, Future[IOResult]] =<some flow>
以便可以将其传递给Result,如下所示:
Result(
header = ResponseHeader(OK, Map(CONTENT_DISPOSITION → s"application")),
body = HttpEntity.Streamed(graph, None, None)
)
任何帮助将不胜感激。谢谢。
需要转换值图:Source [String,Future [IOResult]] == [[到值图:Source [ByteString,Future [IOResult]] =
以便可以将其传递给Result,如图所示。] >
val byteStringSource: Source[ByteString, Future[IOResult]] =
graph.via(Flow.fromFunction(ByteString(_)))