pub trait Volatile {
    // Required methods
    fn get_state_mut(&mut self) -> &mut State;
    fn get_state(&self) -> &State;

    // Provided methods
    fn hash(x: &[u8]) -> [u8; 32] { ... }
    fn key_2_state_key<K: Encode>(key: K) -> [u8; 32] { ... }
    fn stick_key_with_prefix(key: Bytes, prefix: Bytes) -> Bytes { ... }
    fn get<K: Encode>(&self, key: K) -> Option<&Vec<u8>> { ... }
    fn cmp<K: Encode>(&self, key: K, cmp_value: Vec<u8>) -> bool { ... }
    fn value_2_state_value(value: Vec<u8>) -> Result<Vec<u8>, &'static str> { ... }
    fn insert<K: Encode>(
        &mut self,
        key: K,
        val: Vec<u8>
    ) -> Result<([u8; 32], Vec<u8>), &'static str> { ... }
}

Required Methods§

source

fn get_state_mut(&mut self) -> &mut State

source

fn get_state(&self) -> &State

Provided Methods§

source

fn hash(x: &[u8]) -> [u8; 32]

source

fn key_2_state_key<K: Encode>(key: K) -> [u8; 32]

source

fn stick_key_with_prefix(key: Bytes, prefix: Bytes) -> Bytes

source

fn get<K: Encode>(&self, key: K) -> Option<&Vec<u8>>

source

fn cmp<K: Encode>(&self, key: K, cmp_value: Vec<u8>) -> bool

source

fn value_2_state_value(value: Vec<u8>) -> Result<Vec<u8>, &'static str>

source

fn insert<K: Encode>( &mut self, key: K, val: Vec<u8> ) -> Result<([u8; 32], Vec<u8>), &'static str>

Implementors§