noyalib 0.0.21

A pure Rust YAML library with zero unsafe code and full serde integration
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
[package]
name = "noyalib"
version = "0.0.21"
edition = "2024"
rust-version = "1.86.0"
license = "MIT OR Apache-2.0"
description = "A pure Rust YAML library with zero unsafe code and full serde integration"
repository = "https://github.com/sebastienrousseau/noyalib"
homepage = "https://github.com/sebastienrousseau/noyalib"
documentation = "https://docs.rs/noyalib"
readme = "README.md"
keywords = ["yaml", "serde", "serialization", "parser", "safe"]
categories = ["encoding", "parser-implementations", "config"]
authors = ["Sebastien Rousseau <sebastian.rousseau@gmail.com>"]
autoexamples = false
include = [
    "/benches/**",
    "/build.rs",
    "/Cargo.toml",
    "/examples/**",
    "/LICENSE-APACHE",
    "/LICENSE-MIT",
    "/README.md",
    "/src/**",
    "/tests/**",
]

[lib]
name = "noyalib"
path = "src/lib.rs"

## ── Core ──
[[example]]
name = "hello"
path = "examples/hello.rs"
[[example]]
name = "dynamic"
path = "examples/dynamic.rs"
[[example]]
name = "modify"
path = "examples/modify.rs"
[[example]]
name = "deep"
path = "examples/deep.rs"
[[example]]
name = "std"
path = "examples/std.rs"
[[example]]
name = "variants"
path = "examples/variants.rs"
[[example]]
name = "tags"
path = "examples/tags.rs"

## ── Spec ──
[[example]]
name = "alias"
path = "examples/alias.rs"
[[example]]
name = "smart"
path = "examples/smart.rs"
[[example]]
name = "overlay"
path = "examples/overlay.rs"
[[example]]
name = "inherit"
path = "examples/inherit.rs"
[[example]]
name = "stream"
path = "examples/stream.rs"
[[example]]
name = "types"
path = "examples/types.rs"
[[example]]
name = "binary"
path = "examples/binary.rs"

## ── Logic & Security ──
[[example]]
name = "strict"
path = "examples/strict.rs"
[[example]]
name = "secure"
path = "examples/secure.rs"
[[example]]
name = "harden_untrusted"
path = "examples/harden_untrusted.rs"
[[example]]
name = "schema"
path = "examples/schema.rs"
[[example]]
name = "env"
path = "examples/env.rs"

## ── DX ──
[[example]]
name = "errors"
path = "examples/errors.rs"
[[example]]
name = "trace"
path = "examples/trace.rs"
[[example]]
name = "source"
path = "examples/source.rs"
[[example]]
name = "style"
path = "examples/style.rs"

## ── Advanced ──
[[example]]
name = "emit"
path = "examples/emit.rs"
[[example]]
name = "rename"
path = "examples/rename.rs"
[[example]]
name = "flatten"
path = "examples/flatten.rs"
[[example]]
name = "bridge"
path = "examples/bridge.rs"
[[example]]
name = "pipes"
path = "examples/pipes.rs"
[[example]]
name = "global"
path = "examples/global.rs"
[[example]]
name = "bench"
path = "examples/bench.rs"
## ── Future-Proof ──
[[example]]
name = "portable"
path = "examples/portable.rs"
[[example]]
name = "mask"
path = "examples/mask.rs"
[[example]]
name = "patch"
path = "examples/patch.rs"
[[example]]
name = "suggest"
path = "examples/suggest.rs"
[[example]]
name = "schema_ext"
path = "examples/schema_ext.rs"

## ── Deep Rust ──
[[example]]
name = "untagged"
path = "examples/untagged.rs"
[[example]]
name = "borrow"
path = "examples/borrow.rs"
[[example]]
name = "transcode"
path = "examples/transcode.rs"
[[example]]
name = "comments"
path = "examples/comments.rs"

## ── Final ──
[[example]]
name = "async_io"
path = "examples/async_io.rs"
[[example]]
name = "recursive"
path = "examples/recursive.rs"

## ── Platform ──
[[example]]
name = "diagnostic"
path = "examples/diagnostic.rs"
[[example]]
name = "nostd"
path = "examples/nostd.rs"
[[example]]
name = "preserve"
path = "examples/preserve.rs"

## ── Competitive Features ──
[[example]]
name = "replay"
path = "examples/replay.rs"
[[example]]
name = "registry"
path = "examples/registry.rs"
[[example]]
name = "scientific"
path = "examples/scientific.rs"
[[example]]
name = "validation"
path = "examples/validation.rs"
[[example]]
name = "anchor_shared"
path = "examples/anchor_shared.rs"

[[example]]
name = "all"
path = "examples/all.rs"

[[example]]
name = "lossless_edit"
path = "examples/lossless_edit.rs"
[[example]]
name = "cst_surgical_edit"
path = "examples/cst_surgical_edit.rs"

[[example]]
name = "lossless_u64"
path = "examples/lossless_u64.rs"
required-features = ["lossless-u64"]

[[example]]
name = "comments_at"
path = "examples/comments_at.rs"

[[example]]
name = "entry_api"
path = "examples/entry_api.rs"

[[example]]
name = "flattened"
path = "examples/flattened.rs"

[[example]]
name = "schema_validation"
path = "examples/schema_validation.rs"
required-features = ["validate-schema"]

[[example]]
name = "strict_deserialise"
path = "examples/strict_deserialise.rs"
required-features = ["strict-deserialise"]

## ── Ecosystem Citizen ──
[[example]]
name = "include"
path = "examples/include.rs"

[[example]]
name = "figment"
path = "examples/figment.rs"
required-features = ["figment"]

[[example]]
name = "validation_garde"
path = "examples/validation_garde.rs"
required-features = ["garde"]

[[example]]
name = "validation_validator"
path = "examples/validation_validator.rs"
required-features = ["validator"]

[[example]]
name = "diagnostic_path"
path = "examples/diagnostic_path.rs"

[[example]]
name = "robotics_polymorphism"
path = "examples/robotics_polymorphism.rs"
required-features = ["robotics"]

[[example]]
name = "zero_copy_borrow"
path = "examples/zero_copy_borrow.rs"

[[example]]
name = "read_iterator"
path = "examples/read_iterator.rs"

[[example]]
name = "properties_interpolation"
path = "examples/properties_interpolation.rs"

[[example]]
name = "ariadne_diagnostic"
path = "examples/ariadne_diagnostic.rs"
required-features = ["ariadne"]

[[example]]
name = "validated_miette"
path = "examples/validated_miette.rs"
required-features = ["miette", "garde"]

[[example]]
name = "include_directive"
path = "examples/include_directive.rs"
required-features = ["include_fs"]

[[example]]
name = "config_macros"
path = "examples/config_macros.rs"

[[example]]
name = "i18n_formatters"
path = "examples/i18n_formatters.rs"

[[example]]
name = "recovery_lenient"
path = "examples/recovery_lenient.rs"
required-features = ["recovery"]

[[example]]
name = "sval_streaming"
path = "examples/sval_streaming.rs"
required-features = ["sval"]

[[example]]
name = "tokio_async_reader"
path = "examples/tokio_async_reader.rs"
required-features = ["tokio"]

## ── Coverage-gap examples added in v0.0.14 ──
[[example]]
name = "interner"
path = "examples/interner.rs"

[[example]]
name = "parallel"
path = "examples/parallel.rs"
required-features = ["parallel"]

[[example]]
name = "simd"
path = "examples/simd.rs"
required-features = ["simd"]

[dependencies]
serde_core = { version = "1.0", default-features = false, features = ["alloc"] }
serde = { version = "1.0", optional = true, default-features = false, features = ["derive", "alloc"] }
indexmap = { version = ">=2, <3", default-features = false, features = ["serde"] }
rustc-hash = { version = ">=2, <3", default-features = false }
# `rustc_hash::FxHashMap`/`FxHashSet` are std-only aliases. On
# bare-metal targets the maps come from hashbrown instead, keyed by
# the same FxBuildHasher, so hashing behaviour is identical. See #210.
hashbrown = { version = "0.15", default-features = false }
# `core` has no float math: `f64::fract` and `f64::mul_add` are std
# inherent methods. libm supplies them for bare-metal targets;
# hosted builds use the inherent ones and never call into it.
# See #210.
libm = { version = "0.2", default-features = false }
itoa = { version = "1", optional = true }
ryu = { version = "1", optional = true }
memchr = { version = "2.7", default-features = false }
smallvec = { version = "1.13", default-features = false }
miette = { version = "7", optional = true }
ariadne = { version = "0.5", optional = true, default-features = false }
garde = { version = "0.22", optional = true, default-features = false, features = ["derive"] }
validator = { version = "0.21", optional = true, features = ["derive"] }
# NOTE: `serde_yaml` 0.9 is intentionally NOT a noyalib dependency.
# The upstream crate is unmaintained; the `compat-serde-yaml` shim
# exposes a name-for-name surface backed entirely by noyalib's own
# types so downstream `cargo audit` / `cargo deny` runs do not pick
# up the archived advisory chain. Migrating an in-flight
# `::serde_yaml::Value` from an un-migrated module flows through
# the Serde data model — `noyalib::to_value(&upstream_value)?` —
# the same universal-translator path Serde provides for every
# JSON-shaped library pair.
# JSON Schema codegen — derive `JsonSchema` for a Rust type and emit
# the schema as YAML for sharing / contract enforcement. Pulled in
# only when the `schema` feature is on so users who don't need
# codegen don't pay for the dep.
schemars = { version = "1.2", optional = true, default-features = false, features = ["derive", "std"] }
serde_json = { version = "1.0", optional = true }
# JSON Schema *validation* engine — pulled in only when the
# `validate-schema` feature is on. Default features are disabled so
# we don't drag in `reqwest` for HTTP `$ref` resolution; users who
# need that can re-enable it via their own dep.
jsonschema = { version = "0.49", optional = true, default-features = false }
# `figment` integration — drop-in `Provider` for the popular
# layered-configuration crate. Pulled in only when the `figment`
# feature is on so non-figment users don't pay for it.
figment = { version = "0.10", optional = true, features = ["env"] }
# NOTE: `serde-saphyr` lives under `[dependencies]` (not
# `[dev-dependencies]`) because Cargo doesn't allow optional
# dev-deps. It's gated behind the `compare-saphyr` feature and
# only used inside `#[cfg(feature = "compare-saphyr")]` bench
# arms; nothing in the runtime crate references it. Off by default
# so an `--all-features` build doesn't pull in the saphyr crate
# (which is fine on MSRV 1.86+ but still extra deps the rest of
# the workspace doesn't need).
serde-saphyr = { version = "1.0", optional = true }
# Parallel multi-document parsing — pulled in only when the
# `parallel` feature is on. Rayon is the de-facto safe data-parallel
# Rust crate and itself uses well-vetted unsafe internally; the
# `noyalib` runtime call sites stay `#![forbid(unsafe_code)]`.
rayon = { version = "1.10", optional = true }
# `serde_ignored` powers `from_str_strict<T>` — surfaces any keys
# in the input that `T` does not declare. Tiny (no transitive deps),
# but feature-gated behind `strict-deserialise` so the `minimal`
# profile (and FIPS / embedded users with strict dep policies) can
# turn it off.
serde_ignored = { version = "0.1", optional = true }
# Zero-allocation streaming serialization framework — alternative
# to serde for the `sval` feature. Pulled in only when the
# `sval` feature is enabled.
sval = { version = "2", optional = true, default-features = false }
# `tokio` async runtime — required by the `tokio` feature for
# native `AsyncRead` parsing and the `YamlDecoder` codec. Default
# features off; we only need the I/O bits.
tokio = { version = "1", optional = true, default-features = false, features = ["io-util"] }
tokio-util = { version = "0.7", optional = true, default-features = false, features = ["codec"] }
bytes = { version = "1", optional = true, default-features = false }

[dev-dependencies]
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
serde_bytes = "0.11"
criterion = "0.8"
proptest = "1.11"
serde_yaml_ng = "0.10"
yaml-rust2 = "0.11"
rust-yaml = "1.0.1"
# Bench-only competitor surface. None of these ship transitively
# in any release artefact — they are dev-deps used exclusively by
# `crates/noyalib/benches/comparison.rs` for head-to-head Rust
# YAML benchmarks. See `doc/BENCHMARKS.md` for measured numbers.
#
# `yaml-spanned` is the closest other span-tracking parser
# in the ecosystem. (`serde_yml` — the maintainer's prior crate
# — was previously benched here; it was retired in v0.0.6 after
# RUSTSEC-2025-0068 flagged it unsound + unmaintained so the
# OpenSSF Scorecard Vulnerabilities check stays clean. The
# `serde_yaml_ng` comparison row covers the same axis.)
yaml-spanned = "0.0"
# Ecosystem interop verification — proves noyalib's
# `Deserializer<'de>` works with the standard serde wrappers
# without any custom integration code.
serde_path_to_error = "0.1"
# `serde_ignored` is feature-gated as a runtime dep (powers
# `strict-deserialise`); duplicating it as a dev-dep keeps the
# `serde_ecosystem` interop test compiling under
# `--no-default-features` builds.
serde_ignored = "0.1"
# Test-only tokio runtime — the `tokio` feature in `[features]`
# only enables `io-util`; tests need `macros` and the
# `current-thread` runtime to execute `#[tokio::test]` cases.
tokio = { version = "1", features = ["macros", "rt", "io-util"] }

[[bench]]
name = "benchmarks"
harness = false

[[bench]]
name = "comparison"
harness = false

[[bench]]
name = "architecture"
harness = false

[[bench]]
name = "validation_overhead"
harness = false

[[bench]]
name = "incremental_repair"
harness = false

[[bench]]
name = "simd"
harness = false
required-features = ["simd"]

[[bench]]
name = "streaming_vs_value"
harness = false

[[bench]]
name = "mapping_key_clone"
harness = false

[[bench]]
name = "interner"
harness = false

[[bench]]
name = "parallel"
harness = false
required-features = ["parallel"]

[[bench]]
name = "borrowed_vs_value"
harness = false

[[bench]]
name = "large_doc_soak"
harness = false

[[bench]]
name = "structural_bitmask"
harness = false

[[bench]]
name = "numeric_parse"
harness = false

[[bench]]
name = "lossless_u64"
harness = false
required-features = ["lossless-u64"]

[[bench]]
name = "v006_features"
harness = false
required-features = ["recovery", "sval", "tokio"]

[features]
default = ["std", "fast-int", "fast-float", "strict-deserialise"]
# Branchless integer formatting via `itoa` (~10× faster than
# `Display::fmt` on integer scalars). Disabling drops the dep and
# falls back to `core::fmt`; output is identical, only the
# serializer hot path slows down.
fast-int = ["dep:itoa"]
# Branchless float formatting via `ryu` (Grisu-style algorithm).
# Disabling drops the dep and falls back to Rust's `{:?}` Debug
# format, which preserves float-ness (`1.0` stays `1.0`) but emits
# expanded decimal form for very large magnitudes (`{:?}` does not
# auto-switch to scientific notation the way ryu does).
fast-float = ["dep:ryu"]
# `from_str_strict` / `from_slice_strict` / `from_reader_strict`
# — surface YAML keys that the target struct does not declare as
# typed `Error::UnknownField`. Backed by `serde_ignored`. Off in
# the `minimal` profile for FIPS / embedded users with strict
# dep-budget policies; the regular `from_str` path is unaffected.
strict-deserialise = ["dep:serde_ignored"]
# Meta-feature: alias for "std-only, no formatting accelerators,
# no strict-deserialise helper" — for users with strict dep
# budgets (FIPS, embedded, audit-heavy environments) who want one
# explicit opt-in. Equivalent to
# `default-features = false, features = ["std"]`.
minimal = ["std"]
# Synchronise serde's std mode with ours so the `serde_core::de::Error`
# trait's `StdError` super-trait resolves consistently. With this
# wired, `cargo build --no-default-features` truly compiles in
# no_std and serde's de::Error does not require `std::error::Error`.
std = [
    "serde_core/std",
    "serde?/std",
    # These three are declared `default-features = false` so bare-metal
    # targets can build (#210). Hosted builds turn their std back on
    # here, which keeps `rustc_hash::FxHashMap`/`FxHashSet` available
    # and `IndexMap`'s default `RandomState` hasher in place — without
    # this the public signatures that spell `IndexMap<K, V>` would need
    # a third parameter.
    "indexmap/std",
    "rustc-hash/std",
    "memchr/std",
]
miette = ["dep:miette"]
ariadne = ["dep:ariadne"]
robotics = ["dep:serde"]
# `!include` directive — post-parse walk that consults a
# user-supplied `crate::include::IncludeResolver` for every
# `Value::Tagged(!include, _)` node and substitutes the
# resolved content in-place. Pairs with `max_include_depth`
# for cycle bounding. Off by default so callers who never see
# `!include` scalars pay zero compile cost.
include = []
# Filesystem-backed `crate::include::SafeFileResolver` (root
# sandbox, symlink policy). Implies `include` + `std`.
include_fs = ["include", "std"]
garde = ["dep:garde"]
validator = ["dep:validator"]
wasm-opt = []
noyavalidate = ["std", "miette", "miette/fancy", "validate-schema"]
# Drop-in surface compatible with `serde_yaml` 0.9. Adds the
# `noyalib::compat::serde_yaml` module with name-for-name re-exports
# and the `Error` parity needed for logic-transparent migration —
# every type the shim exposes is a noyalib-native type, not a
# re-export of the archived upstream crate. Off by default so users
# who do not need migration help do not see the extra surface.
compat-serde-yaml = []
# Opt-in unsigned integer model for YAML `!!int` scalars in the
# `i64::MAX + 1..=u64::MAX` range. Dependency-free; off by default
# because it exposes an additional public `Number` variant.
lossless-u64 = []
# JSON Schema codegen via `schemars`. With this on you can
# `#[derive(noyalib::JsonSchema)]` for a Rust type and call
# `noyalib::schema_for::<T>()` / `schema_for_yaml::<T>()` to obtain
# the schema as a `Value` or as YAML text. Schema *validation* of
# YAML against the schema is covered by Phase 3.2 (CLI surface).
schema = ["dep:schemars", "dep:serde_json"]
# JSON Schema validation engine. With this on you can call
# `noyalib::validate_against_schema(value, schema)` to enforce a
# JSON Schema 2020-12 contract against parsed YAML data. Implies
# `schema` so the codegen and validation halves of Phase 3 can be
# enabled together with one flag.
validate-schema = ["schema", "dep:jsonschema"]
# `figment` provider integration. With this on, `noyalib::figment`
# exposes a `Yaml` provider that drops into `figment::Figment`
# layering chains the same way `figment::providers::Toml` /
# `figment::providers::Json` do.
figment = ["dep:figment", "std"]
# SIMD-friendly multi-byte search primitives for parser hot paths.
# Ships a feature-gated `noyalib::simd` module containing
# `find_any_of` and friends — vectorised via memchr's SSE2 / NEON
# arity-1/2/3 primitives where applicable, SWAR (8-byte-stride
# u64 packing) for needle sets of 4+ bytes, and a scalar fallback.
# Pure-safe Rust (no `unsafe`) — preserves the workspace
# `unsafe_code = "forbid"` invariant. Off by default so the most
# conservative environments stay on the byte-by-byte baseline; on
# by callers who want the throughput uplift on supported targets.
simd = []
# Opt-in cross-library benchmark comparison against `serde-saphyr`.
# Off by default because the saphyr crate's manifest requires Rust
# 2024 edition (Cargo 1.85+). Enabling this feature pulls saphyr in
# as a dev-dep and gates the comparison bench arms on its presence.
compare-saphyr = ["dep:serde-saphyr"]
# Native async stream parsing on top of `tokio::io::AsyncRead`.
# Adds `noyalib::tokio_async` with `from_async_reader`,
# `from_async_reader_multi`, and a `YamlDecoder` codec for
# `tokio_util::codec::Framed` pipelines. Off by default to keep
# the dep list lean for sync-only callers.
tokio = ["dep:tokio", "dep:tokio-util", "dep:bytes", "std"]
# `sval` zero-allocation streaming serialization framework
# adapter. Adds `impl sval::Value for Value` (and the other
# in-tree value types) plus a `noyalib::sval_adapter::to_sval_writer`
# entry point. serde remains the default; this is opt-in for
# callers that want to skip serde monomorphisation overhead.
sval = ["dep:sval"]
# Error-recovering parser for LSP / IDE partial parsing. Adds
# the `noyalib::recovery` module with `parse_lenient` /
# `parse_lenient_with` entry points returning a `ParseResult`
# carrying the best-effort tree plus the collected error list.
# Pure Rust, no extra deps — turns existing strict-parse retries
# into a recovery pipeline. Off by default because the strict
# path is what most callers want.
recovery = ["std"]
# Parallel multi-document deserialisation via Rayon. Adds the
# `noyalib::parallel` module:
#   - `parallel::parse<T>(&str) -> Result<Vec<T>>` — typed deserialise.
#   - `parallel::values(&str) -> Result<Vec<Value>>` — dynamic-tree variant.
#   - `parallel::split(&str) -> Vec<&str>` — exposed boundary scanner
#     for callers driving their own concurrency primitives.
# All three pre-scan `---` document boundaries on a single thread
# then deserialise each document in parallel via Rayon's global
# thread pool. Off by default to keep the runtime dep list lean
# for users that only parse single-document inputs.
parallel = ["dep:rayon", "std"]
# Portable-SIMD (`std::simd`) structural scanner. Builds a 16/32/
# 64-byte-wide `SimdScanner` that finds any byte in a needle set
# in a single SIMD pass. Requires the nightly toolchain because
# `core::simd` is unstable (`#![feature(portable_simd)]`). On by
# default for nightly users who want maximum throughput; the
# stable `simd` feature still ships the memchr / SWAR fall-back so
# stable builds are not regressed.
nightly-simd = ["simd"]

[package.metadata.docs.rs]
all-features = true
rustdoc-args = ["--cfg", "docsrs"]

# Linting config
[lints.rust]
# Two custom cfg flags are emitted by `build.rs`: `noyalib_nightly`
# (set when rustc is a nightly toolchain so `nightly-simd` can opt
# in) and `noyalib_coverage` (set when `NOYALIB_COVERAGE=1` is
# exported so coverage-instrumentation hot paths can opt out via
# `#[cfg_attr(noyalib_coverage, coverage(off))]`). Declare them
# here as well as in `build.rs` so `cargo publish`'s verification
# pass — which runs without `build.rs` cfg propagation in some
# topologies — does not surface `unexpected_cfgs` warnings.
unexpected_cfgs = { level = "warn", check-cfg = [
    'cfg(noyalib_nightly)',
    'cfg(noyalib_coverage)',
    'cfg(docsrs)',
] }
missing_copy_implementations = "warn"
missing_docs = "warn"
unstable_features = "warn"
unused_extern_crates = "warn"
unused_results = "warn"

bare_trait_objects = "allow"
elided_lifetimes_in_paths = "allow"

missing_debug_implementations = "forbid"
non_ascii_idents = "forbid"
unreachable_pub = "forbid"
unsafe_code = "forbid"

dead_code = "deny"
deprecated_in_future = "deny"
ellipsis_inclusive_range_patterns = "deny"
explicit_outlives_requirements = "deny"
future_incompatible = { level = "deny", priority = -1 }
keyword_idents = { level = "deny", priority = -1 }
macro_use_extern_crate = "deny"
meta_variable_misuse = "deny"
noop_method_call = "deny"
rust_2018_idioms = { level = "deny", priority = -1 }
rust_2021_compatibility = { level = "deny", priority = -1 }
single_use_lifetimes = "deny"
trivial_casts = "deny"
trivial_numeric_casts = "deny"
unused = { level = "deny", priority = -1 }
unused_features = "deny"
unused_import_braces = "deny"
unused_labels = "deny"
unused_lifetimes = "deny"
unused_macro_rules = "deny"
unused_qualifications = "deny"
variant_size_differences = "deny"

[lints.clippy]
cargo = { level = "warn", priority = -1 }
multiple_crate_versions = "allow"

pedantic = { level = "warn", priority = -1 }
nursery = { level = "warn", priority = -1 }
unused_trait_names = "warn"

# TODO fix or expect pedantic
cast_possible_truncation = "allow"
cast_possible_wrap = "allow"
cast_precision_loss = "allow"
cast_sign_loss = "allow"
default_trait_access = "allow"
doc_markdown = "allow"
float_cmp = "allow"
fn_params_excessive_bools = "allow"
format_collect = "allow"
format_push_string = "allow"
items_after_statements = "allow"
manual_let_else = "allow"
many_single_char_names = "allow"
match_same_arms = "allow"
match_wildcard_for_single_variants = "allow"
missing_errors_doc = "allow"
missing_panics_doc = "allow"
naive_bytecount = "allow"
needless_continue = "allow"
needless_pass_by_value = "allow"
redundant_closure_for_method_calls = "allow"
redundant_else = "allow"
return_self_not_must_use = "allow"
similar_names = "allow"
struct_excessive_bools = "allow"
struct_field_names = "allow"
too_many_lines = "allow"
unnecessary_wraps = "allow"
unreadable_literal = "allow"
unused_self = "allow"
used_underscore_binding = "allow"
zero_sized_map_values = "allow"

# TODO fix or expect nursery
branches_sharing_code = "allow"
doc_link_code = "allow"
literal_string_with_formatting_args = "allow"
missing_const_for_fn = "allow"
needless_collect = "allow"
needless_pass_by_ref_mut = "allow"
option_if_let_else = "allow"
or_fun_call = "allow"
redundant_pub_crate = "allow"
significant_drop_tightening = "allow"
single_option_map = "allow"
too_long_first_doc_paragraph = "allow"
useless_let_if_seq = "allow"