facet-core 0.46.0

Core reflection traits and types for the facet ecosystem - provides the Facet trait, Shape metadata, and type-erased pointers
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
//! Facet implementation for Attr

use crate::{Attr, Def, Facet, Shape, ShapeBuilder, Type, UserType, VTableDirect, vtable_direct};

// Attr - treat as opaque (contains OxRef<'static> which is complex)
unsafe impl Facet<'_> for Attr {
    const SHAPE: &'static Shape = &const {
        const VTABLE: VTableDirect = vtable_direct!(Attr => Debug, PartialEq,);

        ShapeBuilder::for_sized::<Attr>("Attr")
            .ty(Type::User(UserType::Opaque))
            .def(Def::Scalar)
            .vtable_direct(&VTABLE)
            .send()
            .sync()
            .build()
    };
}