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
Learn
I want to serialize my types
For application developers using facet-json, facet-yaml, etc. Covers installation, attributes, and format-specific guides.
Extend
I want to build tools with facet
Coming soon — For developers building format crates or tools using reflection (Shape, Peek, Partial).
Contribute
I want to work on facet itself
Coming soon — Architecture, proc macro internals, vtables, and development setup.
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