StorageKey

Trait StorageKey 

Source
pub trait StorageKey {
    // Required method
    fn to_slot(&self, root: B256) -> U256;
}
Expand description

Trait that allows types to be the key of a StorageMap.

Note: the assignment of slots must be injective.

Required Methods§

Source

fn to_slot(&self, root: B256) -> U256

Assigns a slot based on the key and where the map is rooted.

Implementations on Foreign Types§

Source§

impl StorageKey for &str

Source§

fn to_slot(&self, root: B256) -> U256

Source§

impl StorageKey for &[u8]

Source§

fn to_slot(&self, root: B256) -> U256

Source§

impl StorageKey for bool

Source§

fn to_slot(&self, root: B256) -> U256

Source§

impl StorageKey for i8

Source§

fn to_slot(&self, root: B256) -> U256

Source§

impl StorageKey for i16

Source§

fn to_slot(&self, root: B256) -> U256

Source§

impl StorageKey for i32

Source§

fn to_slot(&self, root: B256) -> U256

Source§

impl StorageKey for i64

Source§

fn to_slot(&self, root: B256) -> U256

Source§

impl StorageKey for i128

Source§

fn to_slot(&self, root: B256) -> U256

Source§

impl StorageKey for isize

Source§

fn to_slot(&self, root: B256) -> U256

Source§

impl StorageKey for u8

Source§

fn to_slot(&self, root: B256) -> U256

Source§

impl StorageKey for u16

Source§

fn to_slot(&self, root: B256) -> U256

Source§

impl StorageKey for u32

Source§

fn to_slot(&self, root: B256) -> U256

Source§

impl StorageKey for u64

Source§

fn to_slot(&self, root: B256) -> U256

Source§

impl StorageKey for u128

Source§

fn to_slot(&self, root: B256) -> U256

Source§

impl StorageKey for usize

Source§

fn to_slot(&self, root: B256) -> U256

Source§

impl StorageKey for String

Source§

fn to_slot(&self, root: B256) -> U256

Source§

impl StorageKey for Vec<u8>

Source§

fn to_slot(&self, root: B256) -> U256

Source§

impl StorageKey for Address

Source§

fn to_slot(&self, root: B256) -> U256

Source§

impl<const B: usize, const L: usize> StorageKey for Signed<B, L>

Source§

fn to_slot(&self, root: B256) -> U256

Source§

impl<const B: usize, const L: usize> StorageKey for Uint<B, L>

Source§

fn to_slot(&self, root: B256) -> U256

Source§

impl<const N: usize> StorageKey for FixedBytes<N>

Source§

fn to_slot(&self, root: B256) -> U256

Implementors§