Attributes
- Companion
- class
- Source
- JsoniterTraversal.scala
- Graph
-
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
JsoniterTraversal.type
Members list
Grouped members
Constructors
Build a read-write Traversal over a JSON byte buffer at the given JSONPath — the ONLY string-path constructor, and it keeps the failure in the type. The path MAY contain [*] wildcard steps (without them, this collapses to a single-or-zero-focus Traversal that still uses the MultiFocus[PSVec] carrier — fine, just narrower). An unparseable path comes back as Left(message): a path is DATA, so there is no throwing twin to reach for.
Build a read-write Traversal over a JSON byte buffer at the given JSONPath — the ONLY string-path constructor, and it keeps the failure in the type. The path MAY contain [*] wildcard steps (without them, this collapses to a single-or-zero-focus Traversal that still uses the MultiFocus[PSVec] carrier — fine, just narrower). An unparseable path comes back as Left(message): a path is DATA, so there is no throwing twin to reach for.
Attributes
- Example
-
import com.github.plokhotnyuk.jsoniter_scala.macros.JsonCodecMaker given codec: JsonValueCodec[Long] = JsonCodecMaker.make val itemsT: Either[String, JsoniterTraversal[Long]] = JsoniterTraversal.fromPath[Long]("$.cart.items[*]") val bytes: Array[Byte] = ... itemsT.map(_.foldMap(identity[Long])(bytes)) // Either[String, Long], zero AST allocation itemsT.map(_.modify(_ * 10)(bytes)) // Either[String, Array[Byte]], spliced in place - Source
- JsoniterTraversal.scala
Extensions
Extensions
.field(_.x) — drill every focus into a field, compile-time checked against A.
.field(_.x) — drill every focus into a field, compile-time checked against A.
Attributes
- Source
- JsoniterTraversal.scala
.at(i) — drill every focus into the i-th element of a nested array.
.at(i) — drill every focus into the i-th element of a nested array.
Attributes
- Source
- JsoniterTraversal.scala