seal!() { /* proc-macro */ }Expand description
Seal macro that prevents accidental modification of the enclosed source code
by hashing the source code and comparing it to the supplied hash. If the code
is modified, the macro will fail to compile, and the developer will need to
change the hash value. This is useful for locking down sensitive parts of the
code to prevent their accidental change.
Wraps a code block with a content hash seal, taking a seal id and a code
block (seal!(0x1234, { ... })). The macro emits the block plus a SEAL
constant and fails to compile if the block’s content no longer matches the
supplied seal id, drawing attention to changes in security-sensitive code.