dev.constructive.eo.avro.vulcan
Members list
Type members
Classlikes
vulcan → eo bridge: derive an AvroCodec from a vulcan.Codec (issue #73).
vulcan → eo bridge: derive an AvroCodec from a vulcan.Codec (issue #73).
Every typed entry point in eo-avro — codecPrism[A], AvroPrism.field / widenPath*, AvroTraversal, the AvroJson diagonals — is keyed on eo's own AvroCodec evidence. A codebase whose codecs are vulcan gets in through this bridge instead of hand-writing the same four-line adapter per use site:
import dev.constructive.eo.avro.vulcan.given // every vulcan.Codec[A] now serves as AvroCodec[A]
val p = codecPrism[ClickInfo].field(_.entities) // summons through the bridge
or, named and explicit, given AvroCodec[ClickInfo] = AvroVulcan.codec.
Error mapping — vulcan is Either-typed where eo is total or Throwable-typed:
schemais resolved ONCE at construction and throws vulcan's ownAvroError.throwableif invalid — fail fast: an invalid schema is a codec-definition bug, not a per-record condition, and eo treats schemas as static.encodethrows on error for the same reason (eo'sencode(a: A): Anyis total; an encode failure under a matching schema is a definition bug).decodeerrors surface asLeftviaAvroError.throwable, matching AvroCodec's structured-failure convention.
vulcan rides on cats-eo-avro as an Optional dependency (the AvroJson / circe pattern): this sub-package's API surface names vulcan.Codec, so any caller already depends on vulcan directly — Optional keeps it off downstream classpaths, and avro-only users never load these classfiles.
Attributes
- Source
- AvroVulcan.scala
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
AvroVulcan.type
Givens
Givens
import dev.constructive.eo.avro.vulcan.given makes every in-scope vulcan.Codec[A] usable wherever eo demands AvroCodec[A] evidence. Opt-in by import — don't combine with kindlings-derived AvroCodec givens for the same A in one scope, or the summon turns ambiguous.
import dev.constructive.eo.avro.vulcan.given makes every in-scope vulcan.Codec[A] usable wherever eo demands AvroCodec[A] evidence. Opt-in by import — don't combine with kindlings-derived AvroCodec givens for the same A in one scope, or the summon turns ambiguous.
Attributes
- Source
- AvroVulcan.scala