10 releases

Uses new Rust 2024

new 0.2.5 Apr 10, 2025
0.2.4 Apr 10, 2025
0.1.3 Apr 8, 2025

#243 in Development tools

Download history 144/week @ 2025-04-01 1021/week @ 2025-04-08

1,165 downloads per month

MIT/Apache

240KB
4.5K SLoC

Facet logo - a reflection library for Rust   facet-trait

experimental free of syn crates.io documentation MIT/Apache-2.0 licensed

Thanks to all individual and corporate sponsors, without whom this work could not exist:

Ko-fi GitHub Sponsors Patreon Zed

Defines the core Facet trait that powers runtime reflection in the facet ecosystem.

The Facet Trait

The Facet trait is the foundation of facet's reflection system. Types that implement Facet:

  • Provide their memory layout information
  • Describe their structure (fields, variants, etc.)
  • Enable safe runtime manipulation
  • Can be safely type-erased and restored

Built-in Implementations

This crate provides Facet implementations for many standard library types:

  • Basic types (bool, integers, floats)
  • Collections (Vec, HashMap, etc.)
  • Smart pointers (Box, Rc, Arc)
  • Other common types (String, Option, Result)

These implementations make it easy to use facet with existing Rust code.

License

Licensed under either of:

at your option.

Dependencies

~160KB