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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
//! `wire` is a thin archive facade over rkyv 0.8. It does not define a
//! versioned envelope or promise canonical bytes for semantic values.
//!
//! The archive format is selected by rkyv's Cargo feature-unified format
//! controls, not by the host architecture. With the current rkyv defaults,
//! archives are little-endian, aligned, and encode `usize`/`isize` as 32-bit
//! values. A downstream feature unifier can select a different endianness,
//! alignment, or pointer width. Use [`format_descriptor`](crate::wire::format_descriptor) to observe the
//! effective primitive format in this build and bind it, together with an
//! application schema/version, in any durable or exchanged envelope.
//!
//! rkyv 0.8.18 is the version pinned by this workspace's `Cargo.lock`; the
//! published dependency accepts the compatible `0.8` series. Compatibility
//! still requires the same archived schema and effective format, and a
//! semver-compatible rkyv release. No format migration or old-reader
//! guarantee is provided by this facade.
//!
//! Checked access validates the archive structure supported by the selected
//! rkyv configuration. It does not validate application invariants, schema
//! identity, authorization, freshness, or resource limits. `access` borrows
//! from the aligned archive bytes; `from_bytes` reconstructs an owned value.
//! The re-export also includes rkyv's unchecked APIs, whose callers must meet
//! their unsafe preconditions. These boundaries are part of the consumer
//! contract.
//!
//! This general facade is chosen over a fixed internal profile because
//! enabling a format-control feature here would unify it into downstream
//! builds and could change existing archive layouts. `bincode` offers
//! explicit encoder configuration, but introducing a second codec would not
//! repair this facade's contract and is outside this module's dependency
//! surface. The rkyv format controls and compatibility rules are documented
//! in the [rkyv 0.8 format reference](https://docs.rs/rkyv/0.8.18/rkyv/).
//!
//! This is an archive format, not a semantic canonicalization format. The
//! same value serialized by the same schema and format can be tested for
//! repeatable bytes, but arbitrary `Serialize` implementations, unordered
//! collections, floating-point representations, and shared-pointer topology
//! do not acquire a universal byte-identity guarantee. Do not use these bytes
//! as semantic content identity for hashing or signing without a separate,
//! explicitly constrained canonical profile.
//!
//! Callers derive `Archive`, `Serialize`, and `Deserialize` and choose the
//! rkyv error type at each call, as in `to_bytes::<WireError>(&value)`.
use ;
// ── Re-exports ──────────────────────────────────────────────────────────────
pub use Error as WireError;
pub use AlignedVec;
pub use ;
pub use ;
/// Endianness observed in the effective archived primitive format.
/// Effective rkyv primitive-format properties for this compiled dependency.
///
/// This is not a schema identifier or a complete archive version. Persist or
/// exchange it alongside an application-owned schema/version identifier.
/// Observe format controls selected for the linked rkyv instance.
///
/// rkyv feature unification means the manifest of this crate alone cannot
/// identify the effective format. This probe reports byte order, archived
/// pointer width, and primitive alignment. It deliberately does not invent a
/// schema id or promise that archives of different application types are
/// compatible.
///
/// ```rust
/// use lgwks_std::wire::{Endianness, WireError, format_descriptor};
///
/// let format = format_descriptor()?;
/// assert!(matches!(format.endianness, Endianness::Little | Endianness::Big));
/// # Ok::<(), WireError>(())
/// ```
/// The archive implementation itself, re-exported so a *consumer* crate can
/// derive against it.
///
/// The derives above re-export the macros but not the crate they expand
/// against: the generated code names `::rkyv::…` absolutely, and `rkyv` is
/// `lgwks_std`'s dependency, not the consumer's — so a type in another crate
/// that derives `Archive` through this module fails with "cannot find `rkyv`
/// in the crate root" before it ever reaches a layout question.
///
/// This is the repair. A consumer writes
/// `#[rkyv(crate = lgwks_std::wire::rkyv)]` on its type, which points every
/// generated path at this re-export, and derives the macros from here as
/// normal. It is a re-export of the crate rather than one more hand-picked
/// list of items, because the list is the derive's business and it grows with
/// the derive: naming the items individually is how this module came to be
/// usable only by its own tests.
pub use rkyv;