backhopper_core/envelope_version.rs
1// Copyright (C) 2026 Michael S. Klishin and Contributors
2// SPDX-License-Identifier: Apache-2.0 OR MIT
3// See LICENSE-APACHE and LICENSE-MIT for details.
4
5//! Envelope schema version constants. Kept outside the `schemars`-gated
6//! `schema` module so consumers without the JSON Schema feature can
7//! still read the version numbers.
8
9/// The most recent envelope schema version this build supports.
10/// Bumps on every wire-format change; a fresh `vN.json` is regenerated
11/// in lockstep via `cargo xtask gen-schema --bless`.
12pub const CURRENT_SCHEMA_VERSION: u32 = 18;
13
14/// Lowest version this build embeds. Old versions stay embedded so
15/// `schema show <N>` can answer for any version the binary ever
16/// shipped.
17pub const MIN_EMBEDDED_VERSION: u32 = 1;
18
19/// Versions this build embeds, in ascending order.
20#[must_use]
21pub fn embedded_versions() -> Vec<u32> {
22 (MIN_EMBEDDED_VERSION..=CURRENT_SCHEMA_VERSION).collect()
23}