Attributes
- Companion
- class
- Source
- JsoniterPrism.scala
- Graph
-
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
JsoniterPrism.type
Members list
Grouped members
Optics
Root-level Prism from a JSON byte buffer to a native type A — a Prism[Array[Byte], A]: to decodes the WHOLE document via the codec (Miss when it doesn't decode as A), from / JsoniterPrism.reverseGet encode via writeToArray. At the root the full-cover Prism laws hold (up to canonical re-encoding). Drill from here with .field: JsoniterPrism[Person].field(_.age).
Root-level Prism from a JSON byte buffer to a native type A — a Prism[Array[Byte], A]: to decodes the WHOLE document via the codec (Miss when it doesn't decode as A), from / JsoniterPrism.reverseGet encode via writeToArray. At the root the full-cover Prism laws hold (up to canonical re-encoding). Drill from here with .field: JsoniterPrism[Person].field(_.age).
Attributes
- Source
- JsoniterPrism.scala
Build a read-write Prism over a JSON byte buffer at the given JSONPath.
Build a read-write Prism over a JSON byte buffer at the given JSONPath.
Throws IllegalArgumentException if the path string is not parseable. Path syntax: $, dotted field names ($.foo.bar), array indices ($[0]). See PathParser for the full grammar.
Attributes
- Example
-
import com.github.plokhotnyuk.jsoniter_scala.macros.JsonCodecMaker given codec: JsonValueCodec[Long] = JsonCodecMaker.make val idP = JsoniterPrism.fromPath[Long]("$.payload.user.id") val bytes: Array[Byte] = ... idP.foldMap(identity)(bytes) // Long, no AST allocation - Source
- JsoniterPrism.scala
Extensions
Extensions
.field(_.x) — drill via selector lambda, compile-time checked against A's case fields.
.field(_.x) — drill via selector lambda, compile-time checked against A's case fields.
Attributes
- Source
- JsoniterPrism.scala
.at(i) — drill into the i-th array element.
.each — split into a JsoniterTraversal over the iterated array.
.each — split into a JsoniterTraversal over the iterated array.
Attributes
- Source
- JsoniterPrism.scala