inkpad-support 0.1.0

inkpad supports
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
//! Storage trait
use inkpad_std::Vec;

/// Storage trait
pub trait Storage {
    /// set K for V
    fn set(&mut self, key: Vec<u8>, value: Vec<u8>) -> Option<Vec<u8>>;

    /// get V by K
    ///
    /// use `Vec<u8>` as return because some implementation
    /// is hard to return `&[u8]`
    fn get(&self, key: &[u8]) -> Option<Vec<u8>>;

    /// Remove a key
    fn remove(&mut self, key: &[u8]) -> Option<Vec<u8>>;
}