@zio.dev/zio-blocks 0.0.51 → 0.0.56
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/adr/2026-07-18-data-migration.md +123 -0
- package/guides/async-getting-started.md +687 -0
- package/guides/compile-time-resource-safety-with-scope.md +6 -0
- package/guides/getting-started-with-mux.md +0 -112
- package/guides/query-dsl-extending.md +1 -1
- package/guides/query-dsl-fluent-builder.md +1 -1
- package/guides/query-dsl-reified-optics.md +1 -1
- package/guides/query-dsl-sql.md +395 -1
- package/guides/sql-checked-interpolation.md +173 -0
- package/guides/sql-transactions.md +286 -0
- package/guides/telemetry-guide.md +131 -70
- package/guides/zio-schema-migration.md +6 -6
- package/index.md +200 -559
- package/package.json +1 -1
- package/reference/async.md +1379 -531
- package/reference/chunk.md +3 -3
- package/reference/codegen/index.md +1 -1
- package/reference/combinators.md +4 -4
- package/reference/config/config-decoder.md +460 -0
- package/reference/config/config-source.md +489 -0
- package/reference/config/errors.md +278 -0
- package/reference/config/flags.md +369 -0
- package/reference/config/formats.md +314 -0
- package/reference/config/index.md +304 -0
- package/reference/config/rollout.md +336 -0
- package/reference/context.md +6 -49
- package/reference/data-migration.md +269 -0
- package/reference/datastar/attributes.md +302 -0
- package/reference/datastar/events.md +234 -0
- package/reference/datastar/index.md +256 -0
- package/reference/datastar/signals.md +230 -0
- package/reference/datastar/sse.md +295 -0
- package/reference/datastar.md +2 -2
- package/reference/docs.md +2 -2
- package/reference/endpoint/bulk-creation.md +96 -0
- package/reference/endpoint/endpoint.md +1 -0
- package/reference/endpoint/index.md +9 -89
- package/reference/endpoint/path-codec.md +12 -24
- package/reference/endpoint/route-pattern.md +4 -6
- package/reference/endpoint/segment-codec.md +19 -32
- package/reference/html.md +313 -9
- package/reference/htmx/index.md +4 -52
- package/reference/htmx/response-headers.md +240 -0
- package/reference/http-model/headers.md +735 -0
- package/reference/http-model/index.md +3 -1
- package/reference/http-model/model.md +107 -71
- package/reference/http-model/schema-codecs.md +522 -0
- package/reference/http-model/schema.md +6 -3
- package/reference/http-model/server-sent-event.md +341 -0
- package/reference/jwt.md +195 -0
- package/reference/maybe.md +128 -11
- package/reference/media-type.md +2 -2
- package/reference/mux.mdx +7 -2
- package/reference/openapi.md +3 -3
- package/reference/projection.md +654 -0
- package/reference/resource-management/index.md +1 -1
- package/reference/resource-management/resource.md +2 -98
- package/reference/resource-management/scope.md +1 -209
- package/reference/resource-management/wire.md +4 -50
- package/reference/ringbuffer/advanced.mdx +1 -1
- package/reference/ringbuffer/index.mdx +3 -3
- package/reference/ringbuffer/mpmc.mdx +38 -4
- package/reference/ringbuffer/mpsc.mdx +36 -4
- package/reference/ringbuffer/spmc.mdx +1 -1
- package/reference/ringbuffer/spsc.mdx +87 -15
- package/reference/schema/allows.md +0 -96
- package/reference/schema/binding.md +2 -2
- package/reference/schema/built-in-codecs/avro.md +2 -2
- package/reference/schema/built-in-codecs/bson.md +50 -20
- package/reference/schema/built-in-codecs/csv.md +2 -2
- package/reference/schema/built-in-codecs/index.md +3 -3
- package/reference/schema/built-in-codecs/json/index.md +2 -2
- package/reference/schema/built-in-codecs/json/json.md +1 -0
- package/reference/schema/built-in-codecs/messagepack.md +3 -3
- package/reference/schema/built-in-codecs/thrift.md +2 -2
- package/reference/schema/built-in-codecs/toon.md +3 -3
- package/reference/schema/built-in-codecs/yaml.md +2 -2
- package/reference/schema/codec.md +11 -11
- package/reference/schema/dynamic-optic.md +48 -3
- package/reference/schema/dynamic-schema.md +3 -3
- package/reference/schema/index.md +2 -0
- package/reference/schema/path-interpolator.md +2 -0
- package/reference/schema/reflect-transformer.md +140 -0
- package/reference/schema/schema-evolution/as.md +4 -4
- package/reference/schema/schema-evolution/into.md +2 -2
- package/reference/schema/schema-expr.md +2 -2
- package/reference/schema/schema-search.md +263 -0
- package/reference/schema/schema.md +10 -2
- package/reference/schema/type-class-derivation.md +1 -1
- package/reference/smithy.md +502 -3
- package/reference/sql/db-codec-deriver.md +3 -3
- package/reference/sql/db-codec.md +22 -22
- package/reference/sql/db-con.md +4 -4
- package/reference/sql/db-connection.md +1 -1
- package/reference/sql/db-param.md +1 -1
- package/reference/sql/db-result-reader.md +4 -2
- package/reference/sql/db-tx.md +46 -14
- package/reference/sql/ddl.md +1 -1
- package/reference/sql/frag.md +44 -10
- package/reference/sql/index.md +7 -7
- package/reference/sql/repo.md +15 -15
- package/reference/sql/sql-dialect.md +1 -1
- package/reference/sql/sql-logger.md +1 -1
- package/reference/sql/sql-name-mapper.md +3 -3
- package/reference/sql/table-metadata.md +3 -3
- package/reference/sql/table.md +10 -10
- package/reference/sql/transactor-zio.md +1 -1
- package/reference/sql/transactor.md +21 -11
- package/reference/sql-zio.md +2 -2
- package/reference/streams/core/index.md +32 -0
- package/reference/streams/{pipeline.md → core/pipeline.md} +210 -74
- package/reference/streams/{sink.md → core/sink.md} +331 -353
- package/reference/streams/{stream.md → core/stream.md} +919 -209
- package/reference/streams/execution-and-compatibility/async-execution.md +822 -0
- package/reference/streams/execution-and-compatibility/index.md +35 -0
- package/reference/streams/execution-and-compatibility/platform-differences.md +297 -0
- package/reference/streams/execution-and-compatibility/scala-2-compatibility.md +88 -0
- package/reference/streams/execution-and-compatibility/zero-boxing.md +393 -0
- package/reference/streams/index.md +140 -67
- package/reference/streams/primitives/index.md +30 -0
- package/reference/streams/primitives/reader.md +1992 -0
- package/reference/streams/{writer.md → primitives/writer.md} +254 -98
- package/reference/telemetry/common/any-value.md +90 -0
- package/reference/telemetry/common/attribute-key.md +87 -0
- package/reference/telemetry/common/attributes.md +118 -0
- package/reference/telemetry/common/index.md +39 -0
- package/reference/telemetry/common/instrumentation-scope.md +24 -0
- package/reference/telemetry/common/resource.md +34 -0
- package/reference/telemetry/index.md +311 -0
- package/reference/telemetry/logging/index.md +197 -0
- package/reference/telemetry/logging/log-enrichment.md +72 -0
- package/reference/telemetry/logging/log-formatter.md +100 -0
- package/reference/telemetry/logging/log-record-processor.md +56 -0
- package/reference/telemetry/logging/log-record.md +44 -0
- package/reference/telemetry/logging/log-writer.md +64 -0
- package/reference/telemetry/logging/logger-provider.md +142 -0
- package/reference/telemetry/logging/logger.md +83 -0
- package/reference/telemetry/logging/severity.md +62 -0
- package/reference/telemetry/metrics/index.md +150 -0
- package/reference/telemetry/metrics/instruments.md +183 -0
- package/reference/telemetry/metrics/labeled-instruments.md +74 -0
- package/reference/telemetry/metrics/meter-provider.md +76 -0
- package/reference/telemetry/metrics/meter.md +98 -0
- package/reference/telemetry/metrics/metric-data.md +57 -0
- package/reference/telemetry/otel/custom-exporter.md +216 -0
- package/reference/telemetry/otel/index.md +212 -0
- package/reference/telemetry/tracing/index.md +155 -0
- package/reference/telemetry/tracing/sampler.md +89 -0
- package/reference/telemetry/tracing/span-builder.md +57 -0
- package/reference/telemetry/tracing/span-context.md +39 -0
- package/reference/telemetry/tracing/span-data.md +32 -0
- package/reference/telemetry/tracing/span-kind.md +55 -0
- package/reference/telemetry/tracing/span-processor.md +53 -0
- package/reference/telemetry/tracing/span-status.md +47 -0
- package/reference/telemetry/tracing/span.md +117 -0
- package/reference/telemetry/tracing/tracer-provider.md +91 -0
- package/reference/telemetry/tracing/tracer.md +52 -0
- package/reference/typeid.md +0 -64
- package/sidebars.js +365 -185
- package/undocumented-report.md +528 -270
- package/reference/config.md +0 -158
- package/reference/streams/concurrent-operators.md +0 -106
- package/reference/streams/reader.md +0 -1284
- package/reference/streams/scala-2-compatibility.md +0 -55
- package/reference/streams/zero-boxing.md +0 -275
- package/reference/telemetry.md +0 -693
|
@@ -59,7 +59,7 @@ Creates a new MPSC ring buffer with the given capacity. The capacity must be a p
|
|
|
59
59
|
|
|
60
60
|
To create an MPSC buffer:
|
|
61
61
|
|
|
62
|
-
```scala
|
|
62
|
+
```scala
|
|
63
63
|
import zio.blocks.ringbuffer.MpscRingBuffer
|
|
64
64
|
|
|
65
65
|
val rb = MpscRingBuffer[java.lang.Long](32)
|
|
@@ -119,10 +119,42 @@ Removes up to `limit` elements from the buffer, passing each to the `consumer` c
|
|
|
119
119
|
|
|
120
120
|
When multiple threads produce work for a single processor, use `MpscRingBuffer`. This example shows how three producer threads safely offer items to a single consumer.
|
|
121
121
|
|
|
122
|
-
```scala
|
|
123
|
-
|
|
122
|
+
```scala title="zio-blocks-examples/src/main/scala/ringbuffer/MpscExample.scala"
|
|
123
|
+
package ringbuffer
|
|
124
124
|
|
|
125
|
-
|
|
125
|
+
import zio.blocks.ringbuffer.MpscRingBuffer
|
|
126
|
+
import java.util.concurrent.{CountDownLatch, Thread}
|
|
127
|
+
|
|
128
|
+
object MpscExample extends App {
|
|
129
|
+
val buffer = MpscRingBuffer[java.lang.Integer](16)
|
|
130
|
+
val latch = new CountDownLatch(1)
|
|
131
|
+
|
|
132
|
+
val producers = (0 until 3).map { id =>
|
|
133
|
+
new Thread(() => {
|
|
134
|
+
for (i <- 1 to 4) {
|
|
135
|
+
buffer.offer(java.lang.Integer.valueOf(id * 100 + i))
|
|
136
|
+
}
|
|
137
|
+
})
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
val consumer = new Thread(() => {
|
|
141
|
+
var received = 0
|
|
142
|
+
while (received < 12) {
|
|
143
|
+
val item = buffer.take()
|
|
144
|
+
if (item ne null) {
|
|
145
|
+
println(s"Processed: $item")
|
|
146
|
+
received += 1
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
latch.countDown()
|
|
150
|
+
})
|
|
151
|
+
|
|
152
|
+
producers.foreach(_.start())
|
|
153
|
+
consumer.start()
|
|
154
|
+
producers.foreach(_.join())
|
|
155
|
+
latch.await()
|
|
156
|
+
println("All items processed")
|
|
157
|
+
}
|
|
126
158
|
```
|
|
127
159
|
|
|
128
160
|
([source](https://github.com/zio/zio-blocks/blob/main/zio-blocks-examples/src/main/scala/ringbuffer/MpscExample.scala))
|
|
@@ -104,7 +104,7 @@ Creates a new SPSC ring buffer with the given capacity. The capacity must be a p
|
|
|
104
104
|
|
|
105
105
|
We create an SPSC buffer as follows:
|
|
106
106
|
|
|
107
|
-
```scala
|
|
107
|
+
```scala
|
|
108
108
|
import zio.blocks.ringbuffer.SpscRingBuffer
|
|
109
109
|
|
|
110
110
|
val rb = SpscRingBuffer[String](16) // capacity must be power of 2
|
|
@@ -128,7 +128,7 @@ Inserts the element without blocking. Returns `true` on successful insertion, `f
|
|
|
128
128
|
|
|
129
129
|
To handle backpressure by checking if insertion succeeds:
|
|
130
130
|
|
|
131
|
-
```scala
|
|
131
|
+
```scala
|
|
132
132
|
import zio.blocks.ringbuffer.SpscRingBuffer
|
|
133
133
|
|
|
134
134
|
val rb = SpscRingBuffer[String](4)
|
|
@@ -136,12 +136,17 @@ val rb = SpscRingBuffer[String](4)
|
|
|
136
136
|
|
|
137
137
|
When the buffer becomes full, `offer` returns `false`:
|
|
138
138
|
|
|
139
|
-
```scala
|
|
139
|
+
```scala
|
|
140
140
|
val result1 = rb.offer("a")
|
|
141
|
+
// result1: Boolean = true
|
|
141
142
|
val result2 = rb.offer("b")
|
|
143
|
+
// result2: Boolean = true
|
|
142
144
|
val result3 = rb.offer("c")
|
|
145
|
+
// result3: Boolean = true
|
|
143
146
|
val result4 = rb.offer("d")
|
|
147
|
+
// result4: Boolean = true
|
|
144
148
|
val result5 = rb.offer("e")
|
|
149
|
+
// result5: Boolean = false
|
|
145
150
|
```
|
|
146
151
|
|
|
147
152
|
### Removing Elements — `SpscRingBuffer#take`
|
|
@@ -158,12 +163,17 @@ Retrieves and removes an element from the front of the buffer. Returns immediate
|
|
|
158
163
|
|
|
159
164
|
To retrieve elements in FIFO order:
|
|
160
165
|
|
|
161
|
-
```scala
|
|
166
|
+
```scala
|
|
162
167
|
rb.take()
|
|
168
|
+
// res2: String = "a"
|
|
163
169
|
rb.take()
|
|
170
|
+
// res3: String = "b"
|
|
164
171
|
rb.take()
|
|
172
|
+
// res4: String = "c"
|
|
165
173
|
rb.take()
|
|
174
|
+
// res5: String = "d"
|
|
166
175
|
rb.take()
|
|
176
|
+
// res6: String = null
|
|
167
177
|
```
|
|
168
178
|
|
|
169
179
|
### Checking State — `size`, `isEmpty`, `isFull`
|
|
@@ -202,7 +212,7 @@ Returns `true` if the buffer is at capacity (approximate). O(1).
|
|
|
202
212
|
|
|
203
213
|
All four implementations provide the same three methods. To check state after operations:
|
|
204
214
|
|
|
205
|
-
```scala
|
|
215
|
+
```scala
|
|
206
216
|
import zio.blocks.ringbuffer.SpscRingBuffer
|
|
207
217
|
|
|
208
218
|
val rb2 = SpscRingBuffer[String](8)
|
|
@@ -210,13 +220,18 @@ val rb2 = SpscRingBuffer[String](8)
|
|
|
210
220
|
|
|
211
221
|
State queries are cheap but approximate under concurrency:
|
|
212
222
|
|
|
213
|
-
```scala
|
|
223
|
+
```scala
|
|
214
224
|
rb2.offer("x")
|
|
225
|
+
// res8: Boolean = true
|
|
215
226
|
rb2.offer("y")
|
|
227
|
+
// res9: Boolean = true
|
|
216
228
|
|
|
217
229
|
rb2.size
|
|
230
|
+
// res10: Int = 2
|
|
218
231
|
rb2.isEmpty
|
|
232
|
+
// res11: Boolean = false
|
|
219
233
|
rb2.isFull
|
|
234
|
+
// res12: Boolean = false
|
|
220
235
|
```
|
|
221
236
|
|
|
222
237
|
### Batch Operations — `SpscRingBuffer#drain` and `SpscRingBuffer#fill`
|
|
@@ -243,7 +258,7 @@ Inserts up to `limit` elements by calling the `supplier` for each new element. R
|
|
|
243
258
|
|
|
244
259
|
Batch operations amortize synchronization costs. To drain multiple elements at once:
|
|
245
260
|
|
|
246
|
-
```scala
|
|
261
|
+
```scala
|
|
247
262
|
import zio.blocks.ringbuffer.SpscRingBuffer
|
|
248
263
|
|
|
249
264
|
val rb3 = SpscRingBuffer[java.lang.Integer](16)
|
|
@@ -257,7 +272,7 @@ println(s"Drained items: ${collected.mkString(", ")}")
|
|
|
257
272
|
|
|
258
273
|
To avoid repeated `offer` calls when producing elements, use fill:
|
|
259
274
|
|
|
260
|
-
```scala
|
|
275
|
+
```scala
|
|
261
276
|
import zio.blocks.ringbuffer.SpscRingBuffer
|
|
262
277
|
import java.util.concurrent.atomic.AtomicInteger
|
|
263
278
|
|
|
@@ -288,7 +303,7 @@ In addition, each primitive variant exposes two methods for **in-band end-of-str
|
|
|
288
303
|
|
|
289
304
|
`pollPacked` is intended for advanced consumers that want a single atomic operation distinguishing empty / data / DONE. Most application code that simply needs primitive throughput is fine using the higher-level concurrent stream operators below.
|
|
290
305
|
|
|
291
|
-
```scala
|
|
306
|
+
```scala
|
|
292
307
|
import zio.blocks.ringbuffer.{IntSpscRingBuffer, LongSpscRingBuffer, DoubleSpscRingBuffer}
|
|
293
308
|
|
|
294
309
|
val ints = new IntSpscRingBuffer(16)
|
|
@@ -315,10 +330,36 @@ These variants underpin the primitive-specialized concurrent stream operators (`
|
|
|
315
330
|
|
|
316
331
|
In a single-producer, single-consumer setup, use `SpscRingBuffer` for maximum throughput. This example demonstrates how two threads communicate efficiently using FastFlow signaling.
|
|
317
332
|
|
|
318
|
-
```scala
|
|
319
|
-
|
|
333
|
+
```scala title="zio-blocks-examples/src/main/scala/ringbuffer/SpscExample.scala"
|
|
334
|
+
package ringbuffer
|
|
320
335
|
|
|
321
|
-
|
|
336
|
+
import zio.blocks.ringbuffer.SpscRingBuffer
|
|
337
|
+
import java.util.concurrent.{CountDownLatch, Thread}
|
|
338
|
+
|
|
339
|
+
object SpscExample extends App {
|
|
340
|
+
val buffer = SpscRingBuffer[String](8)
|
|
341
|
+
val latch = new CountDownLatch(1)
|
|
342
|
+
|
|
343
|
+
val producer = new Thread(() => {
|
|
344
|
+
for (i <- 1 to 5) {
|
|
345
|
+
buffer.offer(s"message-$i")
|
|
346
|
+
}
|
|
347
|
+
})
|
|
348
|
+
|
|
349
|
+
val consumer = new Thread(() => {
|
|
350
|
+
for (_ <- 1 to 5) {
|
|
351
|
+
var msg: String = null
|
|
352
|
+
while ({ msg = buffer.take(); msg.eq(null) }) {}
|
|
353
|
+
println(s"Received: $msg")
|
|
354
|
+
}
|
|
355
|
+
latch.countDown()
|
|
356
|
+
})
|
|
357
|
+
|
|
358
|
+
producer.start()
|
|
359
|
+
consumer.start()
|
|
360
|
+
latch.await()
|
|
361
|
+
println("Done")
|
|
362
|
+
}
|
|
322
363
|
```
|
|
323
364
|
|
|
324
365
|
([source](https://github.com/zio/zio-blocks/blob/main/zio-blocks-examples/src/main/scala/ringbuffer/SpscExample.scala))
|
|
@@ -331,10 +372,41 @@ sbt "zio-blocks-examples/runMain ringbuffer.SpscExample"
|
|
|
331
372
|
|
|
332
373
|
Use `fill` and `drain` for efficient batch operations. This example shows how to amortize synchronization costs by processing multiple elements at once.
|
|
333
374
|
|
|
334
|
-
```scala
|
|
335
|
-
|
|
375
|
+
```scala title="zio-blocks-examples/src/main/scala/ringbuffer/BatchExample.scala"
|
|
376
|
+
package ringbuffer
|
|
336
377
|
|
|
337
|
-
|
|
378
|
+
import zio.blocks.ringbuffer.SpscRingBuffer
|
|
379
|
+
import java.util.concurrent.{CountDownLatch, Thread}
|
|
380
|
+
|
|
381
|
+
object BatchExample extends App {
|
|
382
|
+
val buffer = SpscRingBuffer[java.lang.Integer](64)
|
|
383
|
+
val latch = new CountDownLatch(1)
|
|
384
|
+
|
|
385
|
+
val producer = new Thread(() => {
|
|
386
|
+
var batch = 1
|
|
387
|
+
while (batch <= 3) {
|
|
388
|
+
val currentBatch = batch
|
|
389
|
+
val count = buffer.fill(() => java.lang.Integer.valueOf(currentBatch * 100), 10)
|
|
390
|
+
println(s"Filled $count items in batch $currentBatch")
|
|
391
|
+
batch += 1
|
|
392
|
+
}
|
|
393
|
+
})
|
|
394
|
+
|
|
395
|
+
val consumer = new Thread(() => {
|
|
396
|
+
val items = scala.collection.mutable.Buffer[java.lang.Integer]()
|
|
397
|
+
while (items.size < 30) {
|
|
398
|
+
val drained = buffer.drain(items += _, 10)
|
|
399
|
+
if (drained > 0) println(s"Drained $drained items")
|
|
400
|
+
}
|
|
401
|
+
println(s"Total items consumed: ${items.size}")
|
|
402
|
+
latch.countDown()
|
|
403
|
+
})
|
|
404
|
+
|
|
405
|
+
producer.start()
|
|
406
|
+
consumer.start()
|
|
407
|
+
latch.await()
|
|
408
|
+
println("Done")
|
|
409
|
+
}
|
|
338
410
|
```
|
|
339
411
|
|
|
340
412
|
([source](https://github.com/zio/zio-blocks/blob/main/zio-blocks-examples/src/main/scala/ringbuffer/BatchExample.scala))
|
|
@@ -584,22 +584,6 @@ sbt "schema-examples/runMain comptime.AllowsCsvExample"
|
|
|
584
584
|
```
|
|
585
585
|
|
|
586
586
|
```scala title="schema-examples/src/main/scala/comptime/AllowsCsvExample.scala"
|
|
587
|
-
/*
|
|
588
|
-
* Copyright 2024-2026 John A. De Goes and the ZIO Contributors
|
|
589
|
-
*
|
|
590
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
591
|
-
* you may not use this file except in compliance with the License.
|
|
592
|
-
* You may obtain a copy of the License at
|
|
593
|
-
*
|
|
594
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
595
|
-
*
|
|
596
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
597
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
598
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
599
|
-
* See the License for the specific language governing permissions and
|
|
600
|
-
* limitations under the License.
|
|
601
|
-
*/
|
|
602
|
-
|
|
603
587
|
package comptime
|
|
604
588
|
|
|
605
589
|
import zio.blocks.schema._
|
|
@@ -708,22 +692,6 @@ sbt "schema-examples/runMain comptime.AllowsEventBusExample"
|
|
|
708
692
|
```
|
|
709
693
|
|
|
710
694
|
```scala title="schema-examples/src/main/scala/comptime/AllowsEventBusExample.scala"
|
|
711
|
-
/*
|
|
712
|
-
* Copyright 2024-2026 John A. De Goes and the ZIO Contributors
|
|
713
|
-
*
|
|
714
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
715
|
-
* you may not use this file except in compliance with the License.
|
|
716
|
-
* You may obtain a copy of the License at
|
|
717
|
-
*
|
|
718
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
719
|
-
*
|
|
720
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
721
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
722
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
723
|
-
* See the License for the specific language governing permissions and
|
|
724
|
-
* limitations under the License.
|
|
725
|
-
*/
|
|
726
|
-
|
|
727
695
|
package comptime
|
|
728
696
|
|
|
729
697
|
import zio.blocks.schema._
|
|
@@ -830,22 +798,6 @@ sbt "schema-examples/runMain comptime.AllowsGraphQLTreeExample"
|
|
|
830
798
|
```
|
|
831
799
|
|
|
832
800
|
```scala title="schema-examples/src/main/scala/comptime/AllowsGraphQLTreeExample.scala"
|
|
833
|
-
/*
|
|
834
|
-
* Copyright 2024-2026 John A. De Goes and the ZIO Contributors
|
|
835
|
-
*
|
|
836
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
837
|
-
* you may not use this file except in compliance with the License.
|
|
838
|
-
* You may obtain a copy of the License at
|
|
839
|
-
*
|
|
840
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
841
|
-
*
|
|
842
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
843
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
844
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
845
|
-
* See the License for the specific language governing permissions and
|
|
846
|
-
* limitations under the License.
|
|
847
|
-
*/
|
|
848
|
-
|
|
849
801
|
package comptime
|
|
850
802
|
|
|
851
803
|
import zio.blocks.schema._
|
|
@@ -970,22 +922,6 @@ sbt "schema-examples/runMain comptime.AllowsSealedTraitExample"
|
|
|
970
922
|
```
|
|
971
923
|
|
|
972
924
|
```scala title="schema-examples/src/main/scala/comptime/AllowsSealedTraitExample.scala"
|
|
973
|
-
/*
|
|
974
|
-
* Copyright 2024-2026 John A. De Goes and the ZIO Contributors
|
|
975
|
-
*
|
|
976
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
977
|
-
* you may not use this file except in compliance with the License.
|
|
978
|
-
* You may obtain a copy of the License at
|
|
979
|
-
*
|
|
980
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
981
|
-
*
|
|
982
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
983
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
984
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
985
|
-
* See the License for the specific language governing permissions and
|
|
986
|
-
* limitations under the License.
|
|
987
|
-
*/
|
|
988
|
-
|
|
989
925
|
package comptime
|
|
990
926
|
|
|
991
927
|
import zio.blocks.schema._
|
|
@@ -1081,22 +1017,6 @@ object AllowsSealedTraitExample extends App {
|
|
|
1081
1017
|
Demonstrates how Allows constraints are verified at compile time — the code below shows valid examples that compile successfully, and includes comments showing which patterns would be rejected:
|
|
1082
1018
|
|
|
1083
1019
|
```scala title="schema-examples/src/main/scala/comptime/RdbmsExample.scala"
|
|
1084
|
-
/*
|
|
1085
|
-
* Copyright 2024-2026 John A. De Goes and the ZIO Contributors
|
|
1086
|
-
*
|
|
1087
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
1088
|
-
* you may not use this file except in compliance with the License.
|
|
1089
|
-
* You may obtain a copy of the License at
|
|
1090
|
-
*
|
|
1091
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
1092
|
-
*
|
|
1093
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
1094
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
1095
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1096
|
-
* See the License for the specific language governing permissions and
|
|
1097
|
-
* limitations under the License.
|
|
1098
|
-
*/
|
|
1099
|
-
|
|
1100
1020
|
package comptime
|
|
1101
1021
|
|
|
1102
1022
|
import zio.blocks.schema._
|
|
@@ -1290,22 +1210,6 @@ object RdbmsDemo {
|
|
|
1290
1210
|
Demonstrates how Allows enforces recursive schema constraints at compile time:
|
|
1291
1211
|
|
|
1292
1212
|
```scala title="schema-examples/src/main/scala/comptime/DocumentStoreExample.scala"
|
|
1293
|
-
/*
|
|
1294
|
-
* Copyright 2024-2026 John A. De Goes and the ZIO Contributors
|
|
1295
|
-
*
|
|
1296
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
1297
|
-
* you may not use this file except in compliance with the License.
|
|
1298
|
-
* You may obtain a copy of the License at
|
|
1299
|
-
*
|
|
1300
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
1301
|
-
*
|
|
1302
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
1303
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
1304
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1305
|
-
* See the License for the specific language governing permissions and
|
|
1306
|
-
* limitations under the License.
|
|
1307
|
-
*/
|
|
1308
|
-
|
|
1309
1213
|
package comptime
|
|
1310
1214
|
|
|
1311
1215
|
import zio.blocks.schema._
|
|
@@ -336,9 +336,9 @@ Used when the schema of the data is not known at compile time, such as JSON payl
|
|
|
336
336
|
When `F[_, _] = NoBinding` in `Reflect[F[_, _], A]` the `Reflect` structure contains only pure data (no functions) and becomes fully serializable. This enables:
|
|
337
337
|
|
|
338
338
|
1. **Schema serialization**: Convert schemas to JSON Schema or other formats, making them portable
|
|
339
|
-
2. **Schema rebinding**: Deserialize a schema and rebind it using a `
|
|
339
|
+
2. **Schema rebinding**: Deserialize a schema and rebind it using a `BindingResolver`, so it becomes type-safe and operational again
|
|
340
340
|
|
|
341
|
-
|
|
341
|
+
[ReflectTransformer](./reflect-transformer.md) covers schema serialization and rebinding in full detail — the transformer that strips bindings, the one that reattaches them, and how each is exposed as `Schema#toDynamicSchema`/`DynamicSchema#rebind`. For the full API of the binding lookup mechanism used during rebinding, see [BindingResolver](binding-resolver.md).
|
|
342
342
|
|
|
343
343
|
## Summary
|
|
344
344
|
|
|
@@ -26,7 +26,7 @@ Rather than writing custom encoders or relying on string-based Avro schema confi
|
|
|
26
26
|
Add the module to your `build.sbt` (JVM-only, not available for Scala.js):
|
|
27
27
|
|
|
28
28
|
```sbt
|
|
29
|
-
libraryDependencies += "dev.zio" %% "zio-blocks-schema-avro" % "0.0.
|
|
29
|
+
libraryDependencies += "dev.zio" %% "zio-blocks-schema-avro" % "0.0.56"
|
|
30
30
|
```
|
|
31
31
|
|
|
32
32
|
Supported Scala versions: 2.13.x and 3.x
|
|
@@ -341,7 +341,7 @@ object Person {
|
|
|
341
341
|
}
|
|
342
342
|
|
|
343
343
|
val codec = Person.schema.derive(AvroFormat)
|
|
344
|
-
// codec: AvroCodec[Person] = zio.blocks.schema.avro.AvroCodecDeriver$$anon$4@
|
|
344
|
+
// codec: AvroCodec[Person] = zio.blocks.schema.avro.AvroCodecDeriver$$anon$4@7767df5c
|
|
345
345
|
```
|
|
346
346
|
|
|
347
347
|
### Primitive Type Support
|
|
@@ -5,7 +5,7 @@ title: "BSON Codec Module"
|
|
|
5
5
|
|
|
6
6
|
`zio-blocks-schema-bson` is a **schema-driven BSON codec module** for serializing and deserializing Scala types to and from BSON (Binary JSON) format. It provides comprehensive encoding and decoding with support for 27 primitive types, records, variants, sequences, maps, and recursive types.
|
|
7
7
|
|
|
8
|
-
Core types: `BsonCodec`, `BsonEncoder`, `BsonDecoder`, `BsonSchemaCodec`.
|
|
8
|
+
Core types: `BsonCodec`, `BsonEncoder`, `BsonDecoder`, `BsonCodecDeriver`, and the compatibility facade `BsonSchemaCodec`.
|
|
9
9
|
|
|
10
10
|
The module integrates with org.bson to provide native BSON type support including special handling for `ObjectId`, `Decimal128`, and other BSON-specific types.
|
|
11
11
|
|
|
@@ -27,7 +27,7 @@ Rather than writing custom encoders or relying on string-based configuration, yo
|
|
|
27
27
|
Add the module to your `build.sbt`:
|
|
28
28
|
|
|
29
29
|
```sbt
|
|
30
|
-
libraryDependencies += "dev.zio" %% "zio-blocks-schema-bson" % "0.0.
|
|
30
|
+
libraryDependencies += "dev.zio" %% "zio-blocks-schema-bson" % "0.0.56"
|
|
31
31
|
```
|
|
32
32
|
|
|
33
33
|
**Note:** This module is JVM-only and is not available for Scala.js.
|
|
@@ -39,7 +39,7 @@ Supported Scala versions: 2.13.x and 3.x
|
|
|
39
39
|
The module provides a complete pipeline for BSON codec derivation and usage:
|
|
40
40
|
|
|
41
41
|
1. **Define your type** — Any Scala type with a `Schema` instance
|
|
42
|
-
2. **Derive a codec** — Use `
|
|
42
|
+
2. **Derive a codec** — Use `schema.derive(BsonCodecDeriver)` to obtain a `BsonCodec[A]`
|
|
43
43
|
3. **Encode or decode** — Call `codec.encoder.toBsonValue()` or `codec.decoder.fromBsonValue()`
|
|
44
44
|
4. **Handle errors** — Catch `BsonDecoder.Error` with location traces showing where the error occurred
|
|
45
45
|
|
|
@@ -52,9 +52,9 @@ The BSON codec pipeline flows through these layers:
|
|
|
52
52
|
```
|
|
53
53
|
1. User defines Schema[A] for their type
|
|
54
54
|
↓
|
|
55
|
-
2.
|
|
55
|
+
2. Schema[A].derive(BsonCodecDeriver) creates BsonCodec[A]
|
|
56
56
|
↓
|
|
57
|
-
3.
|
|
57
|
+
3. DerivationBuilder traverses the schema and BsonCodecDeriver composes Encoder and Decoder implementations
|
|
58
58
|
- For primitives: type-specific BSON encoders/decoders
|
|
59
59
|
- For records: field-by-field composition
|
|
60
60
|
- For variants: discriminator-based selection
|
|
@@ -64,7 +64,7 @@ The BSON codec pipeline flows through these layers:
|
|
|
64
64
|
4. BsonEncoder writes values to BsonValue or BsonWriter
|
|
65
65
|
BsonDecoder reads BsonValue or BsonReader to values
|
|
66
66
|
↓
|
|
67
|
-
5.
|
|
67
|
+
5. BsonCodecDeriver configuration methods customize behavior
|
|
68
68
|
- Sum type handling (discriminator, wrapper, or none)
|
|
69
69
|
- Field name mapping for MongoDB conventions
|
|
70
70
|
- ObjectId detection and native BSON encoding
|
|
@@ -83,7 +83,7 @@ User type (e.g., case class Person)
|
|
|
83
83
|
↓
|
|
84
84
|
Schema.derived (automatic via macro)
|
|
85
85
|
↓
|
|
86
|
-
|
|
86
|
+
schema.derive(configuredBsonCodecDeriver) → BsonCodec[Person]
|
|
87
87
|
↓
|
|
88
88
|
Use codec.encoder.toBsonValue(person) to serialize
|
|
89
89
|
Use codec.decoder.fromBsonValue(bsonValue) to deserialize
|
|
@@ -110,7 +110,7 @@ object Person {
|
|
|
110
110
|
implicit val schema: Schema[Person] = Schema.derived
|
|
111
111
|
}
|
|
112
112
|
|
|
113
|
-
val codec =
|
|
113
|
+
val codec = Person.schema.derive(BsonCodecDeriver)
|
|
114
114
|
val person = Person("Alice", 30, "alice@example.com")
|
|
115
115
|
val bsonValue = codec.encoder.toBsonValue(person)
|
|
116
116
|
```
|
|
@@ -342,13 +342,11 @@ val rendered = BsonTrace.render(trace) // ".user[0].age"
|
|
|
342
342
|
|
|
343
343
|
---
|
|
344
344
|
|
|
345
|
-
## BsonSchemaCodec
|
|
345
|
+
## BsonCodecDeriver and BsonSchemaCodec
|
|
346
346
|
|
|
347
|
-
|
|
347
|
+
`BsonCodecDeriver` implements the shared `Deriver[BsonCodec]` contract. It supports direct derivation as well as `Schema.deriving` instance and modifier overrides by type, exact optic, or parent type and term name.
|
|
348
348
|
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
`BsonSchemaCodec` provides the `bsonCodec()` method to derive codecs, along with configurable behavior for sum types, field mapping, and ObjectId handling.
|
|
349
|
+
`BsonSchemaCodec` retains `bsonCodec`, `bsonEncoder`, `bsonDecoder`, and `Config` as compatibility and convenience APIs. These methods delegate to `BsonCodecDeriver`, so both entry points have the same BSON behavior.
|
|
352
350
|
|
|
353
351
|
### Configuration
|
|
354
352
|
|
|
@@ -396,18 +394,50 @@ object Person {
|
|
|
396
394
|
implicit val schema: Schema[Person] = Schema.derived
|
|
397
395
|
}
|
|
398
396
|
|
|
399
|
-
val codec =
|
|
397
|
+
val codec = Person.schema.derive(BsonCodecDeriver)
|
|
400
398
|
// codec: BsonCodec[Person] = BsonCodec(
|
|
401
|
-
// encoder = zio.blocks.schema.bson.
|
|
402
|
-
// decoder = zio.blocks.schema.bson.
|
|
399
|
+
// encoder = zio.blocks.schema.bson.BsonCodecDeriver$$anon$5@484f978e,
|
|
400
|
+
// decoder = zio.blocks.schema.bson.BsonCodecDeriver$$anon$6@2785badf
|
|
403
401
|
// )
|
|
404
|
-
val
|
|
405
|
-
//
|
|
406
|
-
// encoder = zio.blocks.schema.bson.
|
|
407
|
-
// decoder = zio.blocks.schema.bson.
|
|
402
|
+
val configuredCodec = Person.schema.derive(BsonCodecDeriver.withIgnoreExtraFields(false))
|
|
403
|
+
// configuredCodec: BsonCodec[Person] = BsonCodec(
|
|
404
|
+
// encoder = zio.blocks.schema.bson.BsonCodecDeriver$$anon$5@454102ab,
|
|
405
|
+
// decoder = zio.blocks.schema.bson.BsonCodecDeriver$$anon$6@71861e6a
|
|
406
|
+
// )
|
|
407
|
+
|
|
408
|
+
// Compatibility facade
|
|
409
|
+
val compatibleCodec = BsonSchemaCodec.bsonCodec(Person.schema)
|
|
410
|
+
// compatibleCodec: BsonCodec[Person] = BsonCodec(
|
|
411
|
+
// encoder = zio.blocks.schema.bson.BsonCodecDeriver$$anon$5@6580f105,
|
|
412
|
+
// decoder = zio.blocks.schema.bson.BsonCodecDeriver$$anon$6@2899e344
|
|
408
413
|
// )
|
|
414
|
+
val configuredCompatibleCodec = BsonSchemaCodec.bsonCodec(Person.schema, BsonSchemaCodec.Config)
|
|
415
|
+
// configuredCompatibleCodec: BsonCodec[Person] = BsonCodec(
|
|
416
|
+
// encoder = zio.blocks.schema.bson.BsonCodecDeriver$$anon$5@6affb8b8,
|
|
417
|
+
// decoder = zio.blocks.schema.bson.BsonCodecDeriver$$anon$6@815743b
|
|
418
|
+
// )
|
|
419
|
+
```
|
|
420
|
+
|
|
421
|
+
### Derivation overrides
|
|
422
|
+
|
|
423
|
+
Use `Schema.deriving` when part of a schema needs a custom codec or runtime modifier:
|
|
424
|
+
|
|
425
|
+
```scala
|
|
426
|
+
val codec = Person.schema
|
|
427
|
+
.deriving(BsonCodecDeriver)
|
|
428
|
+
.instance(Person.schema.reflect.typeId, "age", customIntCodec)
|
|
429
|
+
.modifier(Person.schema.reflect.typeId, "name", Modifier.rename("fullName"))
|
|
430
|
+
.derive
|
|
409
431
|
```
|
|
410
432
|
|
|
433
|
+
Type-level overrides affect every matching occurrence. Parent-type and term-name overloads are also available for fields and variant cases. String map keys remain BSON document field names; override map values or the whole map codec when custom map behavior is needed.
|
|
434
|
+
|
|
435
|
+
Record-level `Modifier.fieldNaming` and `Modifier.noExtraFields` annotations override the corresponding default BSON behavior. Variant-level `Modifier.caseNaming` and `Modifier.discriminator` annotations override class-name mapping and sum-type handling for the annotated variant.
|
|
436
|
+
|
|
437
|
+
### Semantic Json values
|
|
438
|
+
|
|
439
|
+
`zio.blocks.schema.json.Json` objects, arrays, scalars, and nulls map directly to their semantic BSON equivalents. Finite BSON doubles other than signed zero retain their exact value when converted through `Json`; BSON signed zero is normalized to JSON zero because `Json.Number` does not retain its sign. Duplicate `Json.Object` field names are rejected because `BsonDocument` cannot represent them without data loss.
|
|
440
|
+
|
|
411
441
|
---
|
|
412
442
|
|
|
413
443
|
## BsonTrace
|
|
@@ -37,13 +37,13 @@ Rather than writing custom parsers or relying on string-based configuration, you
|
|
|
37
37
|
Add the module to your `build.sbt`:
|
|
38
38
|
|
|
39
39
|
```sbt
|
|
40
|
-
libraryDependencies += "dev.zio" %% "zio-blocks-schema-csv" % "0.0.
|
|
40
|
+
libraryDependencies += "dev.zio" %% "zio-blocks-schema-csv" % "0.0.56"
|
|
41
41
|
```
|
|
42
42
|
|
|
43
43
|
For Scala.js, use `%%%` instead of `%%`:
|
|
44
44
|
|
|
45
45
|
```sbt
|
|
46
|
-
libraryDependencies += "dev.zio" %%% "zio-blocks-schema-csv" % "0.0.
|
|
46
|
+
libraryDependencies += "dev.zio" %%% "zio-blocks-schema-csv" % "0.0.56"
|
|
47
47
|
```
|
|
48
48
|
|
|
49
49
|
Supported Scala versions: 2.13.x and 3.x
|
|
@@ -4,17 +4,17 @@ title: "Built-in Formats and Codecs"
|
|
|
4
4
|
sidebar_label: "Built-in Formats and Codecs"
|
|
5
5
|
---
|
|
6
6
|
|
|
7
|
-
ZIO Blocks Schema provides codec derivation for multiple serialization formats. Once you have a `Schema[A]
|
|
7
|
+
ZIO Blocks Schema provides codec derivation for multiple serialization formats. Once you have a `Schema[A]`, formats can be passed to `Schema.derive`, while BSON is derived with `Schema[A].derive(BsonCodecDeriver)`. The older `BsonSchemaCodec.bsonCodec(schema)` API remains a compatibility facade. See the [Format documentation](../format.md) for details.
|
|
8
8
|
|
|
9
9
|
## Built-in Codecs
|
|
10
10
|
|
|
11
|
-
Here's a summary of the codecs currently supported by ZIO Blocks. Most codecs provide a `BinaryFormat` or `TextFormat
|
|
11
|
+
Here's a summary of the codecs currently supported by ZIO Blocks. Most codecs provide a `BinaryFormat` or `TextFormat`; BSON provides a `Deriver` because it operates on native BSON readers, writers, and values. See the dedicated documentation for details:
|
|
12
12
|
|
|
13
13
|
| Derivation API | Codec Type | MIME Type | Module | Documentation |
|
|
14
14
|
|---------------------|-----------------------|-----------------------|---------------------------------|---------------------------------|
|
|
15
15
|
| `JsonFormat` | `JsonCodec[A]` | `application/json` | `zio-blocks-schema` | [JSON](./json/index.md) |
|
|
16
16
|
| `AvroFormat` | `AvroCodec[A]` | `application/avro` | `zio-blocks-schema-avro` | [Avro](./avro.md) |
|
|
17
|
-
| `
|
|
17
|
+
| `BsonCodecDeriver` | `BsonCodec[A]` | `application/bson` | `zio-blocks-schema-bson` | [BSON](./bson.md) |
|
|
18
18
|
| `CsvFormat` | `CsvCodec[A]` | `text/csv` | `zio-blocks-schema-csv` | [CSV](./csv.md) |
|
|
19
19
|
| `MessagePackFormat` | `MessagePackCodec[A]` | `application/msgpack` | `zio-blocks-schema-messagepack` | [MessagePack](./messagepack.md) |
|
|
20
20
|
| `ThriftFormat` | `ThriftCodec[A]` | `application/thrift` | `zio-blocks-schema-thrift` | [Thrift](./thrift.md) |
|
|
@@ -36,13 +36,13 @@ schema.conforms(person) // true
|
|
|
36
36
|
The JSON codec is included in the ZIO Blocks Schema module. Add it to your `build.sbt`:
|
|
37
37
|
|
|
38
38
|
```scala
|
|
39
|
-
libraryDependencies += "dev.zio" %% "zio-blocks-schema" % "0.0.
|
|
39
|
+
libraryDependencies += "dev.zio" %% "zio-blocks-schema" % "0.0.56"
|
|
40
40
|
```
|
|
41
41
|
|
|
42
42
|
For Scala.js projects, use `%%%` instead:
|
|
43
43
|
|
|
44
44
|
```scala
|
|
45
|
-
libraryDependencies += "dev.zio" %%% "zio-blocks-schema" % "0.0.
|
|
45
|
+
libraryDependencies += "dev.zio" %%% "zio-blocks-schema" % "0.0.56"
|
|
46
46
|
```
|
|
47
47
|
|
|
48
48
|
**Supported Scala versions:** 2.13.x and 3.x
|
|
@@ -27,13 +27,13 @@ Rather than writing custom encoders or relying on string-based schema configurat
|
|
|
27
27
|
Add the module to your `build.sbt`:
|
|
28
28
|
|
|
29
29
|
```sbt
|
|
30
|
-
libraryDependencies += "dev.zio" %% "zio-blocks-schema-messagepack" % "0.0.
|
|
30
|
+
libraryDependencies += "dev.zio" %% "zio-blocks-schema-messagepack" % "0.0.56"
|
|
31
31
|
```
|
|
32
32
|
|
|
33
33
|
For Scala.js, use `%%%` instead of `%%`:
|
|
34
34
|
|
|
35
35
|
```sbt
|
|
36
|
-
libraryDependencies += "dev.zio" %%% "zio-blocks-schema-messagepack" % "0.0.
|
|
36
|
+
libraryDependencies += "dev.zio" %%% "zio-blocks-schema-messagepack" % "0.0.56"
|
|
37
37
|
```
|
|
38
38
|
|
|
39
39
|
Supported Scala versions: 2.13.x and 3.x
|
|
@@ -338,7 +338,7 @@ object Person {
|
|
|
338
338
|
}
|
|
339
339
|
|
|
340
340
|
val codec = Person.schema.derive(MessagePackFormat)
|
|
341
|
-
// codec: MessagePackCodec[Person] = zio.blocks.schema.msgpack.MessagePackCodecDeriver$$anon$3@
|
|
341
|
+
// codec: MessagePackCodec[Person] = zio.blocks.schema.msgpack.MessagePackCodecDeriver$$anon$3@612ff3c4
|
|
342
342
|
```
|
|
343
343
|
|
|
344
344
|
### Primitive Type Support
|