facet is a reflection library for Rust. One derive macro gives you serialization, pretty-printing, diffing, and more.
# [ derive ( Facet )]
struct Config {
name : String ,
port : u16 ,
# [ facet ( sensitive )]
api_key : String ,
}
From this single derive, you get:
- Serialization — JSON, YAML, TOML, KDL, MessagePack
- Pretty-printing — Colored output with sensitive field redaction
- Diffing — Structural comparison between values
- Introspection — Query type information at runtime
Choose your path
Guide
Use facet in your app
Install a format crate, derive Facet, configure attributes, and ship with great diagnostics.
Reference
Look it up fast
Attributes catalog, format matrix, extension namespaces, and FAQs in one place.
Extend
Build on reflection
Create extension attributes, read data with Peek, build values with Partial, and architect new format crates.
Contribute
Work on facet itself
Architecture, derive internals, vtables, unsafe invariants, and the contributor workflow.
Quick links
- Format Support Matrix — Feature comparison across format crates
- Extension Attributes — Format-specific attribute namespaces
- GitHub — Source code and issues
- docs.rs — API documentation