[package]
name = "fmtstruct"
license = "MIT"
version = "0.2.6"
edition = "2024"
rust-version = "1.93"
description = "Format-agnostic configuration loader supporting no_std, alloc, and std."
repository = "https://github.com/canmi21/fmtstruct"
categories = ["config", "no-std", "asynchronous"]
keywords = ["config", "no_std", "serde", "parsing", "struct"]
readme = "README.md"
[dependencies]
serde = { version = "1", default-features = false, features = ["derive"] }
validator = { version = "0.20", default-features = false, features = ["derive"], optional = true }
thiserror = { version = "2", optional = true }
tokio = { version = "1", optional = true, default-features = false, features = ["fs", "io-util"] }
toml = { version = "0.9", optional = true, default-features = false, features = ["parse", "display", "serde"] }
serde_json = { version = "1", optional = true, default-features = false, features = ["alloc"] }
serde_yaml = { version = "0.9", optional = true }
postcard = { version = "1", optional = true, default-features = false, features = ["alloc"] }
async-trait = { version = "0.1", optional = true }
fancy-regex = { version = "0.17", optional = true }
[features]
default = ["std"]
full = ["fs", "json", "toml", "yaml", "postcard", "validate", "regex"]
std = ["alloc", "serde/std", "dep:thiserror"]
alloc = ["serde/alloc", "dep:async-trait"]
fs = ["std", "dep:tokio"]
json = ["dep:serde_json", "alloc"]
toml = ["dep:toml", "alloc"]
yaml = ["dep:serde_yaml", "std"]
postcard = ["dep:postcard", "alloc"]
validate = ["dep:validator"]
regex = ["validate", "std", "dep:fancy-regex"]
[dev-dependencies]
regex = "1"
tempfile = "3"
tokio = { version = "1", features = ["macros", "rt-multi-thread", "fs"] }
[[example]]
name = "basic"
required-features = ["fs", "json"]