trait Deriver[F[_]] extends VersionSpecificDeriver[F]
Deriver builds type class instances based on a Schema.
The minimum set of methods to implement are:
deriveRecordderiveEnumderivePrimitivederiveOptionderiveSequencederiveMapderiveTransformedRecord(for records with more than 22 fields)
In addition to this more methods can be overridden to handle all the supported Schema types of zio-schema:
deriveEither(callsderiveEnumby default)deriveSet(callsderiveSequenceby default)deriveTupleN(callsderiveRecordby default)
The cached method converts this deriver to one that uses a cache of instances shared between macro invocations.
Each derive methods get an optional summoned implicit value of the derived type class. It is the deriver's decision whether to use the available instance (as a user defined customization for a given type) or not.
If the decision is to always accept a summoned value if there is any, use the Deriver.AutoAcceptSummoned trait
which implements this automatically and only calls the trait's methods in case there is no available implicit for
the actual type.
- Self Type
- Deriver[F]
- Alphabetic
- By Inheritance
- Deriver
- VersionSpecificDeriver
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Abstract Value Members
- abstract def deriveEnum[A](enum: Enum[A], cases: => Chunk[WrappedF[F, _]], summoned: => Option[F[A]]): F[A]
- abstract def deriveMap[K, V](map: Map[K, V], key: => F[K], value: => F[V], summoned: => Option[F[Map[K, V]]]): F[Map[K, V]]
- abstract def deriveOption[A](option: Optional[A], inner: => F[A], summoned: => Option[F[Option[A]]]): F[Option[A]]
- abstract def derivePrimitive[A](st: StandardType[A], summoned: => Option[F[A]]): F[A]
- abstract def deriveRecord[A](record: Record[A], fields: => Chunk[WrappedF[F, _]], summoned: => Option[F[A]]): F[A]
- abstract def deriveSequence[C[_], A](sequence: Sequence[C[A], A, _], inner: => F[A], summoned: => Option[F[C[A]]]): F[C[A]]
- abstract def deriveTransformedRecord[A, B](record: Record[A], transform: Transform[A, B, _], fields: => Chunk[WrappedF[F, _]], summoned: => Option[F[B]]): F[B]
Concrete Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def autoAcceptSummoned: Deriver[F]
- lazy val cached: Deriver[F]
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native()
- def deriveEither[A, B](either: Either[A, B], left: => F[A], right: => F[B], summoned: => Option[F[Either[A, B]]]): F[Either[A, B]]
- def derivePrimitiveAlias[A, U](st: StandardType[U], summoned: => Option[F[A]])(implicit arg0: ClassTag[A]): F[A]
- Annotations
- @nowarn()
- def deriveSet[A](set: Set[A], inner: => F[A], summoned: => Option[F[Set[A]]]): F[Set[A]]
- def deriveTupleN[T](schemasAndInstances: => Chunk[(Schema[_], WrappedF[F, _])], summoned: => Option[F[T]]): F[T]
- def deriveUnknown[A](summoned: => Option[F[A]])(implicit arg0: ClassTag[A]): F[A]
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable])
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toString(): String
- Definition Classes
- AnyRef → Any
- def tryDeriveEnum[A](schema: Schema[A], cases: => Chunk[WrappedF[F, _]], summoned: => Option[F[A]])(implicit arg0: ClassTag[A]): F[A]
- def tryDeriveRecord[A](schema: Schema[A], fields: => Chunk[WrappedF[F, _]], summoned: => Option[F[A]])(implicit arg0: ClassTag[A]): F[A]
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()