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
45
46
47
48
49
50
51
52
53
54
55
//! Runtime reflection over protobuf messages.
//!
//! This module provides:
//!
//! - [`DynamicMessage`] — a map-backed message holding [`Value`]s keyed by
//! field number, with descriptor-driven encode/decode.
//! - [`Value`] / [`ValueRef`] / [`MapKey`] — the runtime value representation.
//! - [`ReflectMessage`] / [`ReflectMessageMut`] — the dyn-safe,
//! storage-agnostic accessor traits.
//! - [`Reflectable`] / [`ReflectCow`] — the codegen entry point and the
//! clone-on-write handle that absorbs the bridge/vtable mode difference.
//!
//! ## Architecture note
//!
//! The reflection design (`docs/investigations/reflection.md`) sketches this
//! module as `buffa/src/reflect/`. Implementation found that creates a
//! dependency cycle: `buffa-descriptor` already depends on `buffa` (the
//! generated descriptor types use `buffa::Message`), so `buffa` cannot
//! depend on `buffa-descriptor`. The reflection runtime needs both
//! `buffa::encoding` (wire primitives) and `buffa-descriptor` (descriptor
//! types and the pool), so it has to live in `buffa-descriptor` — which is
//! also the natural home, since reflection consumers already declare
//! `buffa-descriptor` for the descriptor types.
pub use ;
pub use ;
pub use DynamicMessageSeed;
pub use ;
pub use ;
/// Per-message reflection mode, selected at codegen time.
///
/// See [`Reflectable`] for the call-site contract: code written against
/// `foo.reflect()` works identically in `Bridge` and `VTable` mode.