Ecosystem
One #[derive(Facet)] describes your type once. Everything below reads that
description to do something useful: serialize it, diff it, generate a schema,
build a CLI, pretty-print it, or connect it to another system.
Start here
- New to facet? Read the guide first.
- Need JSON? Start with
facet-json. - Looking for a crate? Use the tables below; local guides are linked whenever this repo has one.
- Looking for standard and third-party Rust types that already implement
Facet(Uuid,DateTime,Utf8PathBuf, ...)? See type support.
Core and reflection
The foundation. facet is the crate most users add directly; the others provide
the reflection machinery it re-exports or builds on.
| Crate | What it does | Source |
|---|---|---|
facet | Umbrella crate with #[derive(Facet)], the Facet trait, and the usual public entry points. | facet-rs/facet |
facet-core | Defines Shape, the Def tree, type metadata, and pointer vocabulary for reflection. | facet-rs/facet |
facet-reflect | Reads and builds values of arbitrary reflected shapes with Peek and Partial. | facet-rs/facet |
facet-macros | Implements the Facet derive macro, powered by unsynn. | facet-rs/facet |
Data formats
Serialize and deserialize derived types. Same Rust shape, different wire format.
| Crate | What it does | Source |
|---|---|---|
facet-json | Serializes and deserializes JSON with span-aware diagnostics. | facet-rs/facet |
facet-toml | Serializes and deserializes TOML for Facet types. | facet-rs/facet |
facet-yaml | Serializes and deserializes YAML for Facet types. | facet-rs/facet |
facet-msgpack | Serializes and deserializes MessagePack for Facet types. | facet-rs/facet |
facet-postcard | Serializes and deserializes Postcard for compact binary data. | facet-rs/facet |
facet-csv | Serializes rows and records as CSV. | facet-rs/facet |
facet-asn1 | Serializes and deserializes ASN.1 DER/BER data. | facet-rs/facet |
facet-xdr | Serializes and deserializes XDR binary data. | facet-rs/facet |
facet-urlencoded | Parses and emits application/x-www-form-urlencoded form data. | facet-rs/facet |
XML family
XML uses a tree architecture rather than the usual streaming format path, so these crates live together.
| Crate | What it does | Source |
|---|---|---|
facet-xml | Serializes and deserializes XML for Facet types. | facet-rs/facet |
facet-dom | Provides the tree-based DOM layer shared by HTML and XML support. | facet-rs/facet |
facet-svg | Models strongly typed SVG documents on top of facet-xml. | facet-rs/facet |
facet-atom | Models Atom Syndication Format (RFC 4287) documents. | facet-rs/facet |
Schema and code generation
Project Rust types into other type systems so frontends, APIs, and generated clients stay aligned with the reflected source type.
| Crate | What it does | Source |
|---|---|---|
facet-typescript | Generates TypeScript type definitions from Facet shapes. | facet-rs/facet |
facet-zod | Generates Zod schemas for runtime validation and inferred TypeScript types. Unreleased. | facet-rs/facet |
facet-json-schema | Generates JSON Schema documents from Facet shapes. | facet-rs/facet |
facet-python | Generates Python type definitions from Facet shapes. | facet-rs/facet |
See the schema codegen guide for a full-stack workflow.
Diagnostics and derive plugins
Day-to-day ergonomics: better output, better errors, and less boilerplate.
| Crate | What it does | Source |
|---|---|---|
facet-pretty | Pretty-prints Facet values with structure, color, and sensitive-field redaction. | facet-rs/facet |
rediff | Diffs Facet values structurally and reports path-aware differences. | facet-rs/facet |
facet-default | Derives Default with per-field custom default values. | facet-rs/facet |
facet-error | Derives Error implementations from enum variants and doc comments. | facet-rs/facet |
facet-validate | Runs validation attributes during deserialization. | facet-rs/facet |
Configuration and CLI
Turn reflected Rust types into configuration and command-line interfaces.
| Crate | What it does | Source |
|---|---|---|
figue | Layers CLI args, environment variables, config files, and defaults into one typed model. | facet-rs/facet |
facet-styx | Serializes and deserializes Styx documents for Facet types. | facet-rs/facet |
styx-cli | Provides Styx validation, formatting, schema generation, and language-server tooling. | facet-rs/facet |
facet-cargo-toml | Parses Cargo.toml manifests and Cargo.lock files into typed Rust models. | facet-rs/facet |
Database
Move between database rows and reflected Rust types without writing the same mapping twice.
| Crate | What it does | Source |
|---|---|---|
rusqlite-facet | Binds SQLite query parameters and maps rows through Facet-reflected structs. | facet-rs/facet |
Runtime and incremental computation
Reusable runtime pieces for incremental systems and lowered programs.
| Crate | What it does | Source |
|---|---|---|
picante | Runs Tokio-first incremental queries with memoization and dependency tracking. | facet-rs/facet |
fable | Evaluates a tiny typed language over Facet-reflected Rust values. | facet-rs/facet |
weavy | Provides a lowered-program substrate for interpreters and copy-and-patch backends. | facet-rs/facet |
Web, RPC, and UI
Use Facet shapes at application boundaries: HTTP, RPC, and interactive tools.
| Crate | What it does | Source |
|---|---|---|
facet-axum | Adds Facet-backed extractors and responses for axum. | facet-rs/facet |
vox | Provides Rust-native RPC with cross-language codegen and multiple transport backends. | facet-rs/facet |
facet-egui | Provides an egui inspector and editor widget for any Facet type. Community-maintained. | Erik1000/facet-egui |
Building blocks
Lower-level pieces you may meet while writing a format crate, integration, or tooling around reflection.
| Crate | What it does | Source |
|---|---|---|
facet-value | Stores dynamic Facet values as JSON-like data plus bytes. | facet-rs/facet |
facet-solver | Resolves type shapes from field names and constraints. | facet-rs/facet |
facet-path | Tracks paths through nested Facet structures. | facet-rs/facet |
strid | Defines strongly typed string identifiers with Facet integration. | facet-rs/facet |
Writing a new format crate? The extend section walks through
Peek, Partial, and the format-crate architecture.
Building something facet-adjacent? Open a PR against the website, and we'll add it to the map.