use crate::{ffi, Asm};
pub use {
dkmapping::{DoubleKeyMapping, DoubleKeyTransientMapping},
mapping::{Mapping, TransientMapping},
value::{Storage, TransientStorage},
};
mod dkmapping;
mod mapping;
mod value;
pub trait StorageValue: Asm {
fn sload() -> Self;
}
pub trait TransientStorageValue: Asm {
fn tload() -> Self;
}
impl StorageValue for i32 {
fn sload() -> Self {
unsafe { ffi::asm::sload_i32() }
}
}
impl StorageValue for u32 {
fn sload() -> Self {
unsafe { ffi::asm::sload_u32() }
}
}
impl TransientStorageValue for i32 {
fn tload() -> Self {
unsafe { ffi::asm::tload_i32() }
}
}
impl TransientStorageValue for u32 {
fn tload() -> Self {
unsafe { ffi::asm::tload_u32() }
}
}