reth_revm::interpreter::primitives::alloy_primitives

Macro wrap_fixed_bytes

macro_rules! wrap_fixed_bytes {
    (
        $(#[$attrs:meta])*
        $vis:vis struct $name:ident<$n:literal>;
    ) => { ... };
    (
        extra_derives: [$($extra_derives:path),* $(,)?],
        $(#[$attrs:meta])*
        $vis:vis struct $name:ident<$n:literal>;
    ) => { ... };
}
Expand description

Wrap a fixed-size byte array in a newtype, delegating all methods to the underlying crate::FixedBytes.

This functionally creates a new named FixedBytes that cannot be type-confused for another named FixedBytes.

ยงExamples

use alloy_primitives::wrap_fixed_bytes;

// These hashes are the same length, and have the same functionality, but
// are distinct types
wrap_fixed_bytes!(pub struct KeccakOutput<32>;);
wrap_fixed_bytes!(pub struct MerkleTreeItem<32>;);