macro_rules! register_payload_protocol {
($(#[$meta:meta])* $vis:vis const $name:ident: u32 = $value:expr;) => { ... };
}Expand description
Define a consumer payload-protocol constant with compile-time checks.
Expands to a pub const plus const asserts that the value:
- does not collide with any first-party running-process payload
protocol (
registry::is_first_party), and - lies inside the registered-consumer range (
0x7000..=0x7EFF) or the private-use range (0xF000..=0xFFFF).
running_process::register_payload_protocol! {
/// My daemon's opaque Frame lane.
pub const MY_PAYLOAD_PROTOCOL: u32 = 0x7A63;
}
assert_eq!(MY_PAYLOAD_PROTOCOL, 0x7A63);