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
//! The management-plane contract of zenoh-modem (#119): the registry, its
//! payload types, and the schemas `describe` serves — compiled once, for
//! every driver that serves it.
//!
//! No Zenoh runtime. `zenkey` is linked without its `zenoh` feature, so what
//! is here is the key grammar, the registry slice type and the RFC 08 §7
//! schema envelope: pure data. A driver that links this crate — this
//! repository's, or one for a device the kernel drives — gets the contract
//! and nothing that could open a session; `modem-mgmt` is where the session
//! is.
//!
//! Nothing here knows how a value is produced. `LinkState::of` and its
//! siblings take the facts, not the driver, which is what lets a second
//! driver serve the same documents from a different plane.
use ;
/// The zenkey this contract was compiled against, as `Cargo.lock` pins it —
/// read by `build.rs`, published in `state/modem/sensor` (#122).
pub const ZENKEY_VERSION: &str = env!;
/// Typed key builders generated from `registry/` by `zenkey-build`.
///
/// The registry is the management plane's contract, linted at build time and
/// served verbatim by `@rpc/modem/introspect`, so what a consumer reads is
/// literally what the build enforced.
// Generated code is not ours to lint: it is regenerated from the registry
// on every build, so a warning here is not actionable.
/// The application identity every key is minted under.
///
/// A `static` because `AppProfile::local_origin` takes `&'static self` — the
/// origin is cached in a `OnceLock` and handed out by reference, so the profile
/// has to outlive every key built from it.
///
/// The salt is an application constant, compiled in, identical across every
/// deployment. Changing it re-keys every fleet.
///
/// The two arguments are newtypes since zenkey 0.7, which is worth more here
/// than it looks: they are both `&'static str`, they are adjacent, and
/// transposing them would have compiled and silently re-keyed the fleet.
pub static PROFILE: AppProfile = new;
/// The producer name every driver of this contract publishes under.
///
/// Not the device. The origin is the *host* and the producer is the *component*
/// — the modem itself is a subject chunk, because zenkey RFC 12 §2 decided
/// device-origins never, and because a host may carry more than one device.
pub const PRODUCER: &str = "modem";