Trait Storable

Source
pub trait Storable {
    // Required methods
    fn __load_storage(field: &StoragePath) -> Self;
    fn __save_storage(&mut self, field: &StoragePath);
}
Expand description

Storable trait provides functions as wrapper to getter and setter to the key-value storage in world-state. Impl of this trait is generated by macro. To avoid conflict with user function, function names in this trait are prefix with two underscores.

Required Methods§

Source

fn __load_storage(field: &StoragePath) -> Self

the implementation should eventually call get() to obtain data from world-state and assign the value to the fields of struct

Source

fn __save_storage(&mut self, field: &StoragePath)

the implementation should eventually call set() to obtain fields’ value of struct and save it to world-state

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.

Implementations on Foreign Types§

Source§

impl Storable for bool

Source§

fn __load_storage(field: &StoragePath) -> Self

Source§

fn __save_storage(&mut self, field: &StoragePath)

Source§

impl Storable for i8

Source§

fn __load_storage(field: &StoragePath) -> Self

Source§

fn __save_storage(&mut self, field: &StoragePath)

Source§

impl Storable for i16

Source§

fn __load_storage(field: &StoragePath) -> Self

Source§

fn __save_storage(&mut self, field: &StoragePath)

Source§

impl Storable for i32

Source§

fn __load_storage(field: &StoragePath) -> Self

Source§

fn __save_storage(&mut self, field: &StoragePath)

Source§

impl Storable for i64

Source§

fn __load_storage(field: &StoragePath) -> Self

Source§

fn __save_storage(&mut self, field: &StoragePath)

Source§

impl Storable for i128

Source§

fn __load_storage(field: &StoragePath) -> Self

Source§

fn __save_storage(&mut self, field: &StoragePath)

Source§

impl Storable for u8

Source§

fn __load_storage(field: &StoragePath) -> Self

Source§

fn __save_storage(&mut self, field: &StoragePath)

Source§

impl Storable for u16

Source§

fn __load_storage(field: &StoragePath) -> Self

Source§

fn __save_storage(&mut self, field: &StoragePath)

Source§

impl Storable for u32

Source§

fn __load_storage(field: &StoragePath) -> Self

Source§

fn __save_storage(&mut self, field: &StoragePath)

Source§

impl Storable for u64

Source§

fn __load_storage(field: &StoragePath) -> Self

Source§

fn __save_storage(&mut self, field: &StoragePath)

Source§

impl Storable for u128

Source§

fn __load_storage(field: &StoragePath) -> Self

Source§

fn __save_storage(&mut self, field: &StoragePath)

Source§

impl Storable for usize

Source§

fn __load_storage(field: &StoragePath) -> Self

Source§

fn __save_storage(&mut self, field: &StoragePath)

Source§

impl Storable for String

Source§

fn __load_storage(field: &StoragePath) -> Self

Source§

fn __save_storage(&mut self, field: &StoragePath)

Source§

impl Storable for [u8; 32]

Source§

fn __load_storage(field: &StoragePath) -> Self

Source§

fn __save_storage(&mut self, field: &StoragePath)

Source§

impl<T> Storable for Option<T>

Source§

fn __load_storage(field: &StoragePath) -> Self

Source§

fn __save_storage(&mut self, field: &StoragePath)

Source§

impl<T> Storable for Vec<T>

Source§

fn __load_storage(field: &StoragePath) -> Self

Source§

fn __save_storage(&mut self, field: &StoragePath)

Implementors§

Source§

impl<K, V> Storable for FastMap<K, V>

Source§

impl<K, V> Storable for IterableMap<K, V>

Source§

impl<T> Storable for Vector<T>
where T: Storable + Clone,

Source§

impl<T> Storable for Cacher<T>
where T: Storable,