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.

CrateWhat it doesSource
facetUmbrella crate with #[derive(Facet)], the Facet trait, and the usual public entry points.facet-rs/facet
facet-coreDefines Shape, the Def tree, type metadata, and pointer vocabulary for reflection.facet-rs/facet
facet-reflectReads and builds values of arbitrary reflected shapes with Peek and Partial.facet-rs/facet
facet-macrosImplements the Facet derive macro, powered by unsynn.facet-rs/facet

Data formats

Serialize and deserialize derived types. Same Rust shape, different wire format.

CrateWhat it doesSource
facet-jsonSerializes and deserializes JSON with span-aware diagnostics.facet-rs/facet
facet-tomlSerializes and deserializes TOML for Facet types.facet-rs/facet
facet-yamlSerializes and deserializes YAML for Facet types.facet-rs/facet
facet-msgpackSerializes and deserializes MessagePack for Facet types.facet-rs/facet
facet-postcardSerializes and deserializes Postcard for compact binary data.facet-rs/facet
facet-csvSerializes rows and records as CSV.facet-rs/facet
facet-asn1Serializes and deserializes ASN.1 DER/BER data.facet-rs/facet
facet-xdrSerializes and deserializes XDR binary data.facet-rs/facet
facet-urlencodedParses 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.

CrateWhat it doesSource
facet-xmlSerializes and deserializes XML for Facet types.facet-rs/facet
facet-domProvides the tree-based DOM layer shared by HTML and XML support.facet-rs/facet
facet-svgModels strongly typed SVG documents on top of facet-xml.facet-rs/facet
facet-atomModels 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.

CrateWhat it doesSource
facet-typescriptGenerates TypeScript type definitions from Facet shapes.facet-rs/facet
facet-zodGenerates Zod schemas for runtime validation and inferred TypeScript types. Unreleased.facet-rs/facet
facet-json-schemaGenerates JSON Schema documents from Facet shapes.facet-rs/facet
facet-pythonGenerates 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.

CrateWhat it doesSource
facet-prettyPretty-prints Facet values with structure, color, and sensitive-field redaction.facet-rs/facet
rediffDiffs Facet values structurally and reports path-aware differences.facet-rs/facet
facet-defaultDerives Default with per-field custom default values.facet-rs/facet
facet-errorDerives Error implementations from enum variants and doc comments.facet-rs/facet
facet-validateRuns validation attributes during deserialization.facet-rs/facet

Configuration and CLI

Turn reflected Rust types into configuration and command-line interfaces.

CrateWhat it doesSource
figueLayers CLI args, environment variables, config files, and defaults into one typed model.facet-rs/facet
facet-styxSerializes and deserializes Styx documents for Facet types.facet-rs/facet
styx-cliProvides Styx validation, formatting, schema generation, and language-server tooling.facet-rs/facet
facet-cargo-tomlParses 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.

CrateWhat it doesSource
rusqlite-facetBinds 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.

CrateWhat it doesSource
picanteRuns Tokio-first incremental queries with memoization and dependency tracking.facet-rs/facet
fableEvaluates a tiny typed language over Facet-reflected Rust values.facet-rs/facet
weavyProvides 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.

CrateWhat it doesSource
facet-axumAdds Facet-backed extractors and responses for axum.facet-rs/facet
voxProvides Rust-native RPC with cross-language codegen and multiple transport backends.facet-rs/facet
facet-eguiProvides 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.

CrateWhat it doesSource
facet-valueStores dynamic Facet values as JSON-like data plus bytes.facet-rs/facet
facet-solverResolves type shapes from field names and constraints.facet-rs/facet
facet-pathTracks paths through nested Facet structures.facet-rs/facet
stridDefines 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.