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
//! `reliar-core` is the pure envelope/message model every Reliar crate builds on: identity
//! newtypes, the [`Message`] contract, a validated [`Headers`] map, typed [`Metadata`], and the
//! [`Envelope`]/[`SerializedEnvelope`] pair that carries them (SRS §9–§17).
//!
//! # Guarantees
//!
//! - **Pure.** No storage or transport dependency: no sqlx, no broker client, no routing
//! concept (a Kafka partition key, a `RabbitMQ` exchange, a NATS subject). Every other Reliar
//! crate depends on this one; this one depends on nothing Reliar-specific (ADR 0002).
//! - **One source of truth for framework metadata.** [`Envelope::metadata`] is canonical for
//! every concept Reliar understands. A value here is never duplicated into
//! [`Envelope::headers`], and Reliar never reads a framework value back out of headers
//! (ADR 0004). [`Headers`] reserves the entire `reliar-` prefix, case-insensitively, so a
//! custom header can never collide with — or be mistaken for — a framework one.
//! - **Message identity never depends on `std::any::type_name::<T>()` or a module path.** A
//! [`Message`]'s [`MessageType`] comes from its own `TYPE`/`VERSION` constants, so renaming or
//! moving the Rust type is safe and two distinct types sharing them render identically
//! (ADR 0010).
//! - **One envelope type for both sides of a serialization boundary.** [`Envelope<T>`] and
//! [`SerializedEnvelope`] (`= Envelope<bytes::Bytes>`) are the same generic type; converting
//! between them ([`Envelope::map_body`]) can never drop or duplicate a field (ADR 0003).
//!
//! Every public error is a hand-rolled, `#[non_exhaustive]` enum with a wired
//! [`std::error::Error::source`] — no `thiserror`, no `anyhow`. `Debug` on payload-bearing types
//! elides the bytes; no `Display` here ever prints a payload, a header value, or a credential.
pub use ;
pub use ;
pub use ;
pub use ;
pub use EnvelopeMapper;
pub use ;
pub use ;
pub use Serializer;
pub use ;