pub struct QueryCache<'s, 'k, K, V>where
for<'a> &'a K: Debug + PartialEq + Eq + PrimaryKey<'a>,
K: Clone + Debug + PartialEq + Eq,
V: Clone + Serialize + DeserializeOwned,{ /* private fields */ }Expand description
A cache which stores values in memory to avoid repeated disk reads/writes. Values are accessed through a raw query to another contracts storage.
Implementations§
Trait Implementations§
Source§impl<'s, 'k, K, V> Cacher<'s, 'k, K, V> for QueryCache<'s, 'k, K, V>
impl<'s, 'k, K, V> Cacher<'s, 'k, K, V> for QueryCache<'s, 'k, K, V>
fn must_get_mut(&mut self, deps: Deps<'_>, key: &K) -> CommonResult<&mut V>
fn must_get(&mut self, deps: Deps<'_>, key: &K) -> CommonResult<&V>
Auto Trait Implementations§
impl<'s, 'k, K, V> Freeze for QueryCache<'s, 'k, K, V>
impl<'s, 'k, K, V> RefUnwindSafe for QueryCache<'s, 'k, K, V>
impl<'s, 'k, K, V> Send for QueryCache<'s, 'k, K, V>
impl<'s, 'k, K, V> Sync for QueryCache<'s, 'k, K, V>
impl<'s, 'k, K, V> Unpin for QueryCache<'s, 'k, K, V>
impl<'s, 'k, K, V> UnwindSafe for QueryCache<'s, 'k, K, V>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more