All Downloads are FREE. Search and download functionalities are using the official Maven repository.

i.idealingua-v1-runtime-rpc-scala_3.1.3.16.source-code.MaterializeDerivationMacros.scala Maven / Gradle / Ivy

There is a newer version: 1.3.19
Show newest version
package izumi.idealingua.runtime.circe

import io.circe.{Codec, Decoder, Encoder, derivation}

import scala.deriving.Mirror

final case class DerivationDerivedEncoder[A](value: Encoder.AsObject[A]) extends AnyVal
object DerivationDerivedEncoder {
  inline implicit def materialize[A: Mirror.Of]: DerivationDerivedEncoder[A] = {
    import _root_.izumi.idealingua.runtime.circe.IRTTimeInstances.{*, given}

    DerivationDerivedEncoder(
      io.circe.generic.auto.deriveEncoder[A].instance
    )
  }
}

final case class DerivationDerivedDecoder[A](value: Decoder[A]) extends AnyVal
object DerivationDerivedDecoder {
  inline implicit def materialize[A: Mirror.Of]: DerivationDerivedDecoder[A] = {
    import _root_.izumi.idealingua.runtime.circe.IRTTimeInstances.{*, given}

    DerivationDerivedDecoder(
      io.circe.generic.auto.deriveDecoder[A].instance
    )
  }
}

final case class DerivationDerivedCodec[A](value: Codec.AsObject[A]) extends AnyVal
object DerivationDerivedCodec {
  inline implicit def materialize[A: Mirror.Of]: DerivationDerivedCodec[A] = {
    import _root_.izumi.idealingua.runtime.circe.IRTTimeInstances.{*, given}

    DerivationDerivedCodec(
      Codec.AsObject.from(
        io.circe.generic.auto.deriveDecoder[A].instance,
        io.circe.generic.auto.deriveEncoder[A].instance,
      )
    )
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy