annotated 0.3.1

Declarative validation for structs and enums, like data annotations, that works with serde: every broken rule and missing field in one error
Documentation
# THIS FILE IS AUTOMATICALLY GENERATED BY CARGO
#
# When uploading crates to the registry Cargo will automatically
# "normalize" Cargo.toml files for maximal compatibility
# with all versions of Cargo and also rewrite `path` dependencies
# to registry (e.g., crates.io) dependencies.
#
# If you are reading this file be aware that the original Cargo.toml
# will likely look very different (and much more reasonable).
# See Cargo.toml.orig for the original contents.

[package]
edition = "2024"
rust-version = "1.98"
name = "annotated"
version = "0.3.1"
build = false
autolib = false
autobins = false
autoexamples = false
autotests = false
autobenches = false
description = "Declarative validation for structs and enums, like data annotations, that works with serde: every broken rule and missing field in one error"
readme = "README.md"
keywords = [
    "validation",
    "validator",
    "data-annotations",
    "serde",
    "derive",
]
categories = [
    "encoding",
    "web-programming",
    "rust-patterns",
]
license = "MIT OR Apache-2.0"
repository = "https://github.com/pablocom/annotated"

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

[features]
default = ["serde"]
json = [
    "serde",
    "dep:serde_json",
]
json-schema = [
    "dep:serde_json",
    "annotated-derive/json-schema",
]
regex = [
    "dep:regex",
    "annotated-derive/regex",
]
serde = ["dep:serde"]
unicode = ["dep:unicode-segmentation"]

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

[[test]]
name = "allocations"
path = "tests/allocations.rs"

[[test]]
name = "built_in_rules"
path = "tests/built_in_rules.rs"

[[test]]
name = "compile_errors"
path = "tests/compile_errors.rs"

[[test]]
name = "deserialize"
path = "tests/deserialize.rs"

[[test]]
name = "deserialize_borrowed"
path = "tests/deserialize_borrowed.rs"

[[test]]
name = "deserialize_containers"
path = "tests/deserialize_containers.rs"

[[test]]
name = "deserialize_defaults"
path = "tests/deserialize_defaults.rs"

[[test]]
name = "deserialize_enums"
path = "tests/deserialize_enums.rs"

[[test]]
name = "deserialize_fail_fast"
path = "tests/deserialize_fail_fast.rs"

[[test]]
name = "deserialize_flattened"
path = "tests/deserialize_flattened.rs"

[[test]]
name = "deserialize_formats"
path = "tests/deserialize_formats.rs"

[[test]]
name = "deserialize_nested"
path = "tests/deserialize_nested.rs"

[[test]]
name = "deserialize_rules_as_data"
path = "tests/deserialize_rules_as_data.rs"

[[test]]
name = "deserialize_type_errors"
path = "tests/deserialize_type_errors.rs"

[[test]]
name = "deserialize_variant_rules"
path = "tests/deserialize_variant_rules.rs"

[[test]]
name = "deserialize_with"
path = "tests/deserialize_with.rs"

[[test]]
name = "each"
path = "tests/each.rs"

[[test]]
name = "enums"
path = "tests/enums.rs"

[[test]]
name = "fail_fast"
path = "tests/fail_fast.rs"

[[test]]
name = "field_names"
path = "tests/field_names.rs"

[[test]]
name = "field_rules"
path = "tests/field_rules.rs"

[[test]]
name = "from_deserializer"
path = "tests/from_deserializer.rs"

[[test]]
name = "json"
path = "tests/json.rs"

[[test]]
name = "json_schema"
path = "tests/json_schema.rs"

[[test]]
name = "nested"
path = "tests/nested.rs"

[[test]]
name = "option_fields"
path = "tests/option_fields.rs"

[[test]]
name = "rules_as_data"
path = "tests/rules_as_data.rs"

[[test]]
name = "struct_rules"
path = "tests/struct_rules.rs"

[[test]]
name = "url_rule"
path = "tests/url_rule.rs"

[[test]]
name = "user_rules"
path = "tests/user_rules.rs"

[[test]]
name = "variant_rules"
path = "tests/variant_rules.rs"

[dependencies.annotated-derive]
version = "=0.3.1"

[dependencies.regex]
version = "1.13.1"
optional = true

[dependencies.serde]
version = "1.0.229"
optional = true

[dependencies.serde_json]
version = "1.0.154"
optional = true

[dependencies.unicode-segmentation]
version = "1.13.3"
optional = true

[dev-dependencies.allocation-counter]
version = "0.8.1"

[dev-dependencies.iri-string]
version = "0.7.14"

[dev-dependencies.proptest]
version = "1.12.0"
features = ["std"]
default-features = false

[dev-dependencies.serde]
version = "1.0.229"
features = ["derive"]

[dev-dependencies.serde_json]
version = "1.0.154"

[dev-dependencies.serde_test]
version = "1.0.177"

[dev-dependencies.trybuild]
version = "1.0.122"

[lints.clippy]
self_named_module_files = "warn"

[lints.clippy.pedantic]
level = "warn"
priority = -1

[lints.rust]
missing_docs = "warn"
unsafe_code = "forbid"