sqlhash

Macro sqlhash 

Source
macro_rules! sqlhash {
    ($n:literal, $s:literal) => { ... };
}
Expand description

Macro to create a SqlFixedBytes<N> from a hex string literal at compile time.

Usage:

use ethereum_mysql::{sqlhash, SqlFixedBytes};
const HASH: SqlFixedBytes<32> = sqlhash!(32, "0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef");
const SHORT: SqlFixedBytes<4> = sqlhash!(4, "0x12345678");

N 必须是字面量(literal),与 hex 长度匹配,否则编译报错。