facet_core/impls/internal/
shape_layout.rs

1//! Facet implementation for ShapeLayout
2
3use crate::{
4    Def, Facet, Shape, ShapeBuilder, ShapeLayout, Type, UserType, VTableDirect, vtable_direct,
5};
6
7unsafe impl Facet<'_> for ShapeLayout {
8    const SHAPE: &'static Shape = &const {
9        const VTABLE: VTableDirect = vtable_direct!(ShapeLayout =>
10            Debug,
11            Hash,
12        );
13
14        // ShapeLayout is an enum but we treat it as opaque for now
15        // since Layout doesn't have a Facet impl
16        ShapeBuilder::for_sized::<ShapeLayout>("ShapeLayout")
17            .ty(Type::User(UserType::Opaque))
18            .def(Def::Scalar)
19            .vtable_direct(&VTABLE)
20            .copy()
21            .send()
22            .sync()
23            .build()
24    };
25}