izumi.idealingua.runtime.rpc.IRTOutputMiddleware.scala Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of idealingua-v1-runtime-rpc-scala_3 Show documentation
Show all versions of idealingua-v1-runtime-rpc-scala_3 Show documentation
idealingua-v1-runtime-rpc-scala
package izumi.idealingua.runtime.rpc
import io.circe.Json
import izumi.functional.bio.{Applicative2, F}
trait IRTOutputMiddleware[F[_, _], C] {
def apply(
methodId: IRTMethodId
)(context: C,
response: IRTResBody,
encodedResponse: Json,
): F[Throwable, Json]
}
object IRTOutputMiddleware {
def empty[F[+_, +_]: Applicative2, C] = new Empty[F, C]
final class Empty[F[+_, +_]: Applicative2, C] extends IRTOutputMiddleware[F, C] {
override def apply(methodId: IRTMethodId)(context: C, response: IRTResBody, encodedResponse: Json): F[Throwable, Json] = {
F.pure(encodedResponse)
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy