Trait fadroma::prelude::ReadonlyStorage
source · [−]pub trait ReadonlyStorage {
fn get(&self, key: &[u8]) -> Option<Vec<u8, Global>>;
fn range(
&'a self,
start: Option<&[u8]>,
end: Option<&[u8]>,
order: Order
) -> Box<dyn Iterator<Item = (Vec<u8, Global>, Vec<u8, Global>)> + 'a, Global>;
}
Expand description
ReadonlyStorage is access to the contracts persistent data store
Required Methods
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.
Allows iteration over a set of key/value pairs, either forwards or backwards.
The bound start
is inclusive and end
is exclusive.
If start
is lexicographically greater than or equal to end
, an empty range is described, mo matter of the order.