For the complete documentation index, see llms.txt.
aztec-nr - noir_aztec::messages::msg_type

Function custom_msg_type_id

pub comptime fn custom_msg_type_id(local_id: u64) -> u64

Creates a custom message type ID from a local index.

Custom message handlers must use message type IDs >= MIN_CUSTOM_MSG_TYPE_ID. This function offsets the provided local_id by that minimum, making it clear at the call site that a custom (non-built-in) message type is being defined.

Examples

global MY_MSG_TYPE_ID: u64 = custom_msg_type_id(0);
global MY_OTHER_MSG_TYPE_ID: u64 = custom_msg_type_id(1);