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
// SPDX-License-Identifier: Apache-2.0
// Copyright (c) 2026 DeRec Alliance. All rights reserved.
use fmt;
/// DeRec protocol version supported by this SDK.
///
/// This type represents the protocol-level version carried in the
/// [`DeRecMessage`](derec_proto::DeRecMessage) envelope:
///
/// - `protocolVersionMajor`
/// - `protocolVersionMinor`
///
/// This is **not** the same as the Rust crate version, npm package version,
/// or NuGet package version. Package versions identify SDK releases, while
/// `ProtocolVersion` identifies the DeRec wire protocol version expected by
/// protocol messages.
///
/// # Fields
///
/// * `major` - Protocol major version.
/// * `minor` - Protocol minor version.
///
/// # Compatibility
///
/// The compatibility policy associated with protocol major/minor versions is
/// defined by the DeRec protocol specification, not by this helper type.
///
/// # Example
///
/// ```rust
/// use derec_library::protocol_version::ProtocolVersion;
///
/// let version = ProtocolVersion::current();
///
/// assert!(version.major >= 0);
/// assert!(version.minor >= 0);
/// ```
/// Current DeRec protocol version supported by this SDK.
///
/// This constant is the source of truth for the protocol version reported by
/// [`ProtocolVersion::current`].
///
/// # Example
///
/// ```rust
/// use derec_library::protocol_version::{CURRENT, ProtocolVersion};
///
/// assert_eq!(CURRENT, ProtocolVersion::current());
/// ```
pub const CURRENT: ProtocolVersion = ProtocolVersion ;