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
//! DESIGN.md §4 — the event envelope, generic over its payload.
//!
//! Design rule (P1): the engine frames, orders, and persists bodies but
//! never interprets them. Only projections do. The payload type `B` is a
//! free parameter — the agent vocabulary in [`crate::agent`] is just one
//! choice of `B`, not something the core depends on. Adding a new payload
//! variant must never require touching `log/`.
use DeserializeOwned;
use ;
/// One durable, offset-ordered fact carrying a payload of type `B`.
///
/// The engine treats `body` as opaque bytes-to-be; it round-trips it
/// through serde without ever matching on it.
/// The bound set every payload type must satisfy, aliased under one name so
/// the engine's generic signatures stay legible (`B: Body` rather than the
/// four-trait mouthful everywhere).
///
/// It is *blanket-implemented*: any type that is serde-serializable,
/// owned-deserializable, cloneable, and `'static` is a `Body`
/// automatically, so implementers never write `impl Body` by hand.
/// `DeserializeOwned` (rather than `Deserialize<'de>`) is what lets the log
/// hand back a payload that owns its data, decoupled from the lifetime of
/// the record bytes it was decoded from.