1use crate::{Def, ValueVTable, value_vtable};
2use crate::{Facet, Shape, Type, UserType};
3
4#[repr(transparent)]
6pub struct Opaque<T>(pub T);
7
8unsafe impl<'a, T: 'a> Facet<'a> for Opaque<T> {
9 const VTABLE: &'static ValueVTable =
12 &const { value_vtable!((), |f, _opts| write!(f, "{}", Self::SHAPE.type_identifier)) };
13
14 const SHAPE: &'static Shape = &const {
15 Shape::builder_for_sized::<Self>()
16 .type_identifier("Opaque")
17 .ty(Type::User(UserType::Opaque))
18 .def(Def::Scalar)
19 .build()
20 };
21}