[package]
edition = "2024"
rust-version = "1.93"
name = "fmtstruct"
version = "0.2.4"
build = false
autolib = false
autobins = false
autoexamples = false
autotests = false
autobenches = false
description = "Format-agnostic configuration loader supporting no_std, alloc, and std."
readme = "README.md"
keywords = [
"config",
"no_std",
"serde",
"parsing",
"struct",
]
categories = [
"config",
"no-std",
"asynchronous",
]
license = "MIT"
repository = "https://github.com/canmi21/fmtstruct"
[features]
alloc = [
"serde/alloc",
"dep:async-trait",
]
default = ["std"]
fs = [
"std",
"dep:tokio",
]
full = [
"fs",
"json",
"toml",
"yaml",
"postcard",
"validate",
"regex",
"postcard_std",
]
json = [
"dep:serde_json",
"alloc",
]
postcard = [
"dep:postcard",
"alloc",
]
postcard_std = [
"postcard",
"std",
"postcard/use-std",
]
regex = [
"validate",
"std",
"dep:fancy-regex",
]
std = [
"alloc",
"serde/std",
"dep:thiserror",
]
toml = [
"dep:toml",
"alloc",
]
validate = ["dep:validator"]
yaml = [
"dep:serde_yaml",
"std",
]
[lib]
name = "fmtstruct"
path = "src/lib.rs"
[[example]]
name = "basic"
path = "examples/basic.rs"
required-features = [
"fs",
"json",
]
[[test]]
name = "format_tests"
path = "tests/format_tests.rs"
[[test]]
name = "loader_tests"
path = "tests/loader_tests.rs"
[[test]]
name = "preprocess_tests"
path = "tests/preprocess_tests.rs"
[[test]]
name = "source_tests"
path = "tests/source_tests.rs"
[[test]]
name = "validation_tests"
path = "tests/validation_tests.rs"
[dependencies.async-trait]
version = "0.1"
optional = true
[dependencies.fancy-regex]
version = "0.17"
optional = true
[dependencies.postcard]
version = "1"
features = ["alloc"]
optional = true
default-features = false
[dependencies.serde]
version = "1"
features = ["derive"]
default-features = false
[dependencies.serde_json]
version = "1"
features = ["alloc"]
optional = true
default-features = false
[dependencies.serde_yaml]
version = "0.9"
optional = true
[dependencies.thiserror]
version = "2"
optional = true
[dependencies.tokio]
version = "1"
features = [
"fs",
"io-util",
]
optional = true
default-features = false
[dependencies.toml]
version = "0.9"
features = [
"parse",
"display",
"serde",
]
optional = true
default-features = false
[dependencies.validator]
version = "0.20"
features = ["derive"]
optional = true
default-features = false
[dev-dependencies.regex]
version = "1"
[dev-dependencies.tempfile]
version = "3"
[dev-dependencies.tokio]
version = "1"
features = [
"macros",
"rt-multi-thread",
"fs",
]