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