pub trait StorageKey {
// Required method
fn as_storage_bytes(&self) -> impl AsRef<[u8]>;
}Expand description
Trait for types that can be used as storage mapping keys.
Keys are hashed using keccak256 along with the mapping’s base slot to determine the final storage location. This trait provides the byte representation used in that hash.
Required Methods§
fn as_storage_bytes(&self) -> impl AsRef<[u8]>
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.