Struct cosmwasm_storage::Bucket [−][src]
pub struct Bucket<'a, T> where
T: Serialize + DeserializeOwned, { /* fields omitted */ }
Implementations
save will serialize the model and store, returns an error on serialization issues
load will return an error if no data is set at the given key, or on parse error
may_load will parse the data stored at the key if present, returns Ok(None) if no data there. returns an error on issues parsing
pub fn range<'b>(
&'b self,
start: Option<&[u8]>,
end: Option<&[u8]>,
order: Order
) -> Box<dyn Iterator<Item = StdResult<Record<T>>> + 'b>
Loads the data, perform the specified action, and store the result in the database. This is shorthand for some common sequences, which may be useful.
If the data exists, action(Some(value))
is called. Otherwise action(None)
is called.