io.github.netvl.picopickle.TypesComponent
Creates a new writer from a partial function of type T => backend.BValue
.
Creates a new writer from a partial function of type T => backend.BValue
.
This is the main constructor for custom writers. The writers returned by this function ignore the accumulator argument (as most of writers should do).
An example:
case class A(x: Int, y: String) import backendConversionImplicits._ implicit val aWriter: Writer[A] = Writer { case A(x, y) => Map("a" -> x.toBackend, "b" -> y.toBackend).toBackend }
As manual construction of complex objects may quickly turn very unwieldy, it is recommended to use converters instead.
source type
a function defining writer behavior
a writer delegating to the provided function
Creates a new writer from a function of type T => (Option[backend.BValue] => backend.BValue)
.
Creates a new writer from a function of type T => (Option[backend.BValue] => backend.BValue)
.
Mostly intended for internal use. Regular clients should use apply method.
source type
a function defining writer behavior
a writer delegating to the provided function
Same as writePF0, but does not delegate nulls handling to NullHandler
.
Same as writePF0, but does not delegate nulls handling to NullHandler
.
Mostly intended for internal use. Regular clients should use apply method.
source type
a function defining writer behavior
a writer delegating to the provided function
Creates a new writer from a partial function of type (T, Option[backend.BValue]) => backend.BValue
.
Creates a new writer from a partial function of type (T, Option[backend.BValue]) => backend.BValue
.
Mostly intended for internal use. Regular clients should use apply method.
source type
a function defining writer behavior
a writer delegating to the provided function
Contains various constructors for custom Writers.