Skip to main content

neo_devpack_solidity/runtime/storage/storage_impl/
query.rs

1use super::*;
2
3impl StorageQuery {
4    /// Create new storage query
5    pub fn new(account: String) -> Self {
6        Self {
7            account,
8            key_prefix: None,
9            limit: None,
10            include_pending: false,
11        }
12    }
13
14    /// Set key prefix filter
15    pub fn with_prefix(mut self, prefix: Vec<u8>) -> Self {
16        self.key_prefix = Some(prefix);
17        self
18    }
19
20    /// Set result limit
21    pub fn with_limit(mut self, limit: usize) -> Self {
22        self.limit = Some(limit);
23        self
24    }
25
26    /// Include pending changes in results
27    pub fn include_pending(mut self) -> Self {
28        self.include_pending = true;
29        self
30    }
31}