• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

facet-rs / facet / 19826479017

01 Dec 2025 02:41PM UTC coverage: 58.333% (+0.3%) from 58.04%
19826479017

push

github

fasterthanlime
Remove FieldFlags/FieldVTable, make attributes single source of truth

This is a major refactor of how field metadata is stored and accessed:

- Remove FieldFlags bitflags and FieldVTable from Field struct
- All field metadata now lives in the ExtensionAttr attributes array
- Add helper methods: is_flattened(), is_sensitive(), is_child(),
  should_skip_serializing(), default_fn(), skip_serializing_if_fn(), etc.
- Remove deserialize_with/serialize_with syntax entirely
- Use proxy = ProxyType pattern exclusively for custom serialization

Grammar changes:
- Add builtin attribute grammar with variant kinds: unit, newtype,
  newtype_str, predicate, fn_ptr, make_t, shape_type
- Third-party crates now have same power as built-ins via namespaced
  attributes (e.g., #[facet(kdl::child)])

API changes:
- fields_for_serialize() now returns (FieldItem, Peek) instead of
  (Field, Peek) to support runtime field name changes for flattening
- Add KdlFieldExt trait for kdl::child attribute compatibility

561 of 829 new or added lines in 29 files covered. (67.67%)

52 existing lines in 16 files now uncovered.

18961 of 32505 relevant lines covered (58.33%)

185.16 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/facet-core/src/impls_std/path.rs
1
use crate::*;
2

3
unsafe impl Facet<'_> for std::path::PathBuf {
4
    const SHAPE: &'static Shape = &const {
5
        Shape::builder_for_sized::<Self>()
UNCOV
6
            .vtable(value_vtable!(std::path::PathBuf, |f, _opts| write!(
×
7
                f,
×
8
                "{}",
9
                Self::SHAPE.type_identifier
×
10
            )))
11
            .type_identifier("PathBuf")
12
            .ty(Type::User(UserType::Opaque))
13
            .def(Def::Scalar)
14
            .build()
15
    };
16
}
17

18
unsafe impl Facet<'_> for std::path::Path {
19
    const SHAPE: &'static Shape = &const {
20
        Shape::builder_for_unsized::<Self>()
UNCOV
21
            .vtable(value_vtable!(std::path::Path, |f, _opts| write!(
×
22
                f,
×
23
                "{}",
24
                Self::SHAPE.type_identifier
×
25
            )))
26
            .type_identifier("Path")
27
            .ty(Type::User(UserType::Opaque))
28
            .def(Def::Scalar)
29
            .build()
30
    };
31
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc