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
//! The two hashes that turn a name into a number at compile time.
//!
//! [`vmcall_enum!`](crate::vmcall_enum) builds its discriminants out of the
//! 32-bit one and [`tag_enum!`](crate::tag_enum) out of the 64-bit one. Call
//! them directly when you need the same number on the other side of a boundary
//! the macros do not cross — a C component, or a guest agent computing the
//! vmcall it is about to make.
/// FNV-1a over `s`, 32 bits, evaluated at compile time.
///
/// This is the number `vmcall_enum!` gives a variant, so a guest agent or a C
/// component can spell the same discriminant from the same name.
///
/// # Examples
///
/// ```ignore
/// const READY: u32 = fnv1a_32("Ready");
/// assert_eq!(READY, 0x0bca_3294);
/// ```
pub const
/// FNV-1a over `s`, 64 bits, evaluated at compile time.
///
/// `tag_enum!` hashes `"EnumName::VariantName"` with this, so the same string
/// here reproduces a tag by hand.
///
/// # Examples
///
/// ```ignore
/// const WRITE_FILE: u64 = fnv1a_64("CmdTag::WriteFile");
/// assert_eq!(WRITE_FILE, 0x0e3a_03f3_7c93_bb56);
/// ```
pub const