1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
//! Compile-time reflection, via [`facet`], for registering hao's types with an
//! external consumer such as a scripting runtime. Enabled by the `reflect`
//! feature (which also turns on `sync`).
//!
//! Every reflected type derives [`facet::Facet`], so a consumer never registers
//! them one by one: it starts from the shape in [`roots`] and walks that shape's
//! fields and variants (which reference other shapes) to reach every reflected
//! type transitively. The graph is cyclic — a method references its declaring
//! type, which lists the method again — but a shape describes a *type*, not a
//! value, so a walker that dedups by shape pointer terminates.
//!
//! The reflected surface is the modeled metadata graph reachable from
//! [`Module`](crate::Module): its entries (types, methods, fields, ...),
//! signatures and IL. The raw metadata tables and the backing image bytes are
//! load/write details and are left out.
//!
//! Some types are deliberately [opaque](facet::Type::User) — they appear in the
//! graph as sized black boxes rather than exposing their contents:
//!
//! - **bitflags** sets ([`TypeAttributes`](crate::dotnet::md::streams::tables_stream::TypeAttributes),
//! etc.): their flag names are `const`s, which no derive can surface. Read them
//! through [`bitflags::Flags::FLAGS`], which gives each flag's name and value.
//! - The row-id cell on each [`Entry`](crate::dotnet::entries::Entry), an
//! implementation detail of how entries track their original table row.
use ;
use crate::;
/// The reflected roots. Walking [`Module`]'s fields and variants reaches every
/// stored type; the others are computed views ([`ConstantValue`] from
/// [`Constant::decode`](crate::dotnet::entries::Constant::decode), [`TypeKind`]
/// from [`TypeDef::kind`](crate::dotnet::entries::TypeDef::kind)) that are not
/// reachable by walking, so they are listed explicitly.