https://github.com/facet-rs/facet
Rust reflection, serialization, deserialization — know the shape of your types
https://github.com/facet-rs/facet
deserialization rust rust-lang serialization
Last synced: 8 months ago
JSON representation
Rust reflection, serialization, deserialization — know the shape of your types
- Host: GitHub
- URL: https://github.com/facet-rs/facet
- Owner: facet-rs
- License: apache-2.0
- Created: 2025-03-10T09:48:16.000Z (9 months ago)
- Default Branch: main
- Last Pushed: 2025-04-06T10:23:13.000Z (9 months ago)
- Last Synced: 2025-04-06T10:28:56.522Z (9 months ago)
- Topics: deserialization, rust, rust-lang, serialization
- Language: Rust
- Homepage:
- Size: 759 KB
- Stars: 119
- Watchers: 0
- Forks: 2
- Open Issues: 10
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE-APACHE
Awesome Lists containing this project
- awesome - facet-rs/facet - Rust reflection, serialization, deserialization, pretty printing, etc. — the last proc macro you should need (Rust)
README
# facet
[](https://github.com/fasterthanlime/facet)
[](https://github.com/fasterthanlime/free-of-syn)
[](https://crates.io/crates/facet)
[](https://docs.rs/facet)
[](./LICENSE)
Thanks to all individual and corporate sponsors, without whom this work could not exist:
facet provides type reflection for Rust, in const contexts.
Any type that implements `Facet` trait returns a `Shape`, which describes:
* The memory layout of the type
* Its definition: struct fields, underlying type for newtypes, etc.
* How to drop it in place
The `Poke` type is able to allocate (or work from a `&mut MaybeUninit`)
any Facet type, and gradually initialize its fields — until the fully-built
value is moved out of the partial.
The `Peek` type helps perform read operations on any Facet type.
It comes with a derive macro that uses [unsynn](https://crates.io/crates/unsynn)
for speed of compilation.
## Ecosystem
There are separate crates for the trait, the core types, the derive macro, peek, poke,
and various serializers, deserializers, and pretty printers etc.
The hub for everything is the [facet](https://crates.io/crates/facet) crate.
You can start with its [README](https://github.com/facet-rs/facet/blob/main/facet/README.md).
## License
Licensed under either of:
- Apache License, Version 2.0 ([LICENSE-APACHE](https://github.com/facet-rs/facet/blob/main/LICENSE-APACHE) or )
- MIT license ([LICENSE-MIT](https://github.com/facet-rs/facet/blob/main/LICENSE-MIT) or )
at your option.