AvroPrismMacro
Macros backing the drilling sugar on AvroPrism and AvroTraversal — .field(_.x), selectDynamic, .at(i), .union[Branch], .each, .fields(...). Mirror of circe.JsonPrismMacro, with two-given codec summoning (AvroEncoder + AvroDecoder) collapsed to one AvroCodec wrapper. Uses '{ this } rather than 'this (scalafix-parser limitation).
Attributes
- Source
- AvroPrismMacro.scala
- Graph
-
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
AvroPrismMacro.type
Members list
Value members
Concrete methods
Macro for .at(i). Verifies A <: Iterable, extracts the element type, summons the codec, emits widenPathIndex.
Macro for .at(i). Verifies A <: Iterable, extracts the element type, summons the codec, emits widenPathIndex.
Attributes
- Source
- AvroPrismMacro.scala
Traversal counterpart to atImpl — extends the suffix by an array index.
Traversal counterpart to atImpl — extends the suffix by an array index.
Attributes
- Source
- AvroPrismMacro.scala
.each — emits toTraversal[B] over A's element type.
Build a child AvroPrism[B] from a parent AvroPrism[A] via a compile-time selector (_.field) plus an in-scope AvroCodec[B].
Build a child AvroPrism[B] from a parent AvroPrism[A] via a compile-time selector (_.field) plus an in-scope AvroCodec[B].
Attributes
- Source
- AvroPrismMacro.scala
Traversal counterpart to fieldImpl — extends the suffix by a named field.
Traversal counterpart to fieldImpl — extends the suffix by a named field.
Attributes
- Source
- AvroPrismMacro.scala
.fields(_.a, _.b, ...) — multi-field focus. Validates arity ≥ 2, duplicate-ness, known fields, non-nested. Synthesises an NT in SELECTOR order, summons AvroCodec[NT], emits toFieldsPrism. Mirrors JsonPrismMacro.fieldsImpl.
.fields(_.a, _.b, ...) — multi-field focus. Validates arity ≥ 2, duplicate-ness, known fields, non-nested. Synthesises an NT in SELECTOR order, summons AvroCodec[NT], emits toFieldsPrism. Mirrors JsonPrismMacro.fieldsImpl.
Attributes
- Source
- AvroPrismMacro.scala
Traversal counterpart to fieldsImpl.
Drives codecPrism[Person].name. Looks name up on A's schema, summons AvroCodec[B], emits widenPath. Returns Expr[Any] so transparent inline refines per call site.
Drives codecPrism[Person].name. Looks name up on A's schema, summons AvroCodec[B], emits widenPath. Returns Expr[Any] so transparent inline refines per call site.
Attributes
- Source
- AvroPrismMacro.scala
Traversal counterpart to selectFieldImpl — drives Dynamic sugar by extending the suffix.
Traversal counterpart to selectFieldImpl — drives Dynamic sugar by extending the suffix.
Attributes
- Source
- AvroPrismMacro.scala
.union[Branch] — drill into one alternative of a union-shaped focus. Supported parent shapes: Option[T] (user writes .union[T]), sealed traits, Scala 3 enum, and Scala 3 untagged unions A | B | C (Branch must be one of the members). Branch identifier resolves at runtime off AvroCodec[Branch].schema.getFullName (robust against kindlings naming drift).
.union[Branch] — drill into one alternative of a union-shaped focus. Supported parent shapes: Option[T] (user writes .union[T]), sealed traits, Scala 3 enum, and Scala 3 untagged unions A | B | C (Branch must be one of the members). Branch identifier resolves at runtime off AvroCodec[Branch].schema.getFullName (robust against kindlings naming drift).
Attributes
- Source
- AvroPrismMacro.scala
Traversal counterpart to unionImpl — narrows the per-element focus to one union branch by appending a PathStep.UnionBranch to the suffix. Same validation as the prism path.
Traversal counterpart to unionImpl — narrows the per-element focus to one union branch by appending a PathStep.UnionBranch to the suffix. Same validation as the prism path.
Attributes
- Source
- AvroPrismMacro.scala