Trait cosmwasm_std::Storage [−][src]
pub trait Storage { fn get(&self, key: &[u8]) -> Option<Vec<u8>>; fn set(&mut self, key: &[u8], value: &[u8]); fn remove(&mut self, key: &[u8]); }
Storage provides read and write access to a persistent storage.
If you only want to provide read access, provide &Storage
Required methods
fn get(&self, key: &[u8]) -> Option<Vec<u8>>
[src]
Returns None when key does not exist.
Returns Some(Vec
Note: Support for differentiating between a non-existent key and a key with empty value is not great yet and might not be possible in all backends. But we’re trying to get there.
fn set(&mut self, key: &[u8], value: &[u8])
[src]
fn remove(&mut self, key: &[u8])
[src]
Removes a database entry at key
.
The current interface does not allow to differentiate between a key that existed before and one that didn’t exist. See https://github.com/CosmWasm/cosmwasm/issues/290
Implementors
Loading content...