zink::storage::mapping

Trait TransientMapping

Source
pub trait TransientMapping {
    type Key: Asm;
    type Value: TransientStorageValue;

    const STORAGE_SLOT: i32;

    // Required method
    fn storage_key(key: Self::Key) -> [u8; 32];

    // Provided methods
    fn get(key: Self::Key) -> Self::Value { ... }
    fn set(key: Self::Key, value: Self::Value) { ... }
}
Expand description

Transient storage mapping interface

Required Associated Constants§

Required Associated Types§

Required Methods§

Source

fn storage_key(key: Self::Key) -> [u8; 32]

Provided Methods§

Source

fn get(key: Self::Key) -> Self::Value

Get value from transient storage key.

Source

fn set(key: Self::Key, value: Self::Value)

Set key and value in transient storage

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.

Implementors§