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, 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.
Ecosystem
See the whole map
Every facet-related crate — formats, schema codegen, CLI, diffing, pretty-printing — with links to docs and source.
Showcases
See it in action
Interactive examples for JSON, YAML, args parsing, pretty-printing, diffing, and more.
Reference
Look it up fast
Attributes catalog and format matrix.
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
- Getting Started — Install, derive, ship
- Ecosystem map — Every facet crate and where to find it
- JSON guide — The flagship workflow
- Format Support Matrix — Feature comparison across format crates
- GitHub · crates.io · docs.rs · Discord