File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed
commons-core/src/main/scala/com/avsystem/commons/serialization/cbor Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -22,6 +22,16 @@ abstract class HasCborCodec[T](implicit instances: MacroInstances[CborOptimizedC
2222 implicit lazy val codec : GenObjectCodec [T ] = instances(CborOptimizedCodecs , this ).cborCodec
2323}
2424
25+ /**
26+ * Like [[HasCborCodec ]] but allows injecting additional implicits - like [[HasGenCodecWithDeps ]].
27+ */
28+ abstract class HasCborCodecWithDeps [D , T ](implicit
29+ deps : ValueOf [D ],
30+ instances : MacroInstances [(CborOptimizedCodecs , D ), CborAdtInstances [T ]]
31+ ) {
32+ implicit lazy val codec : GenObjectCodec [T ] = instances((CborOptimizedCodecs , deps.value), this ).cborCodec
33+ }
34+
2535/**
2636 * Apply this annotation on a sealed trait/class whose companion extends [[HasCborCodec ]] in order to customize
2737 * the CBOR field key used for discriminator field. Note: this annotation automatically applies [[flatten ]] annotation
You can’t perform that action at this time.
0 commit comments