Struct miden_processor::utils::collections::RecordingMap
pub struct RecordingMap<K, V> { /* private fields */ }Expand description
A RecordingMap that records read requests to the underlying key-value map.
The data recorder is used to generate a proof for read requests.
The RecordingMap is composed of three parts:
data: which contains the current set of key-value pairs in the map.updates: which tracks keys for which values have been since the map was instantiated. updates include both insertions and updates of values under existing keys.trace: which contains the key-value pairs from the original data which have been accesses since the map was instantiated.
Implementations§
§impl<K, V> RecordingMap<K, V>where
K: Ord + Clone,
V: Clone,
impl<K, V> RecordingMap<K, V>where K: Ord + Clone, V: Clone,
pub fn new(init: impl IntoIterator<Item = (K, V)>) -> RecordingMap<K, V>
pub fn new(init: impl IntoIterator<Item = (K, V)>) -> RecordingMap<K, V>
Returns a new RecordingMap instance initialized with the provided key-value pairs. (BTreeMap).
pub fn into_proof(self) -> BTreeMap<K, V, Global>
pub fn into_proof(self) -> BTreeMap<K, V, Global>
Consumes the RecordingMap and returns a BTreeMap containing the key-value pairs from the initial data set that were read during recording.
Trait Implementations§
§impl<K, V> Clone for RecordingMap<K, V>where
K: Clone,
V: Clone,
impl<K, V> Clone for RecordingMap<K, V>where K: Clone, V: Clone,
§fn clone(&self) -> RecordingMap<K, V>
fn clone(&self) -> RecordingMap<K, V>
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more§impl<K, V> Debug for RecordingMap<K, V>where
K: Debug,
V: Debug,
impl<K, V> Debug for RecordingMap<K, V>where K: Debug, V: Debug,
§impl<K, V> Default for RecordingMap<K, V>where
K: Default,
V: Default,
impl<K, V> Default for RecordingMap<K, V>where K: Default, V: Default,
§fn default() -> RecordingMap<K, V>
fn default() -> RecordingMap<K, V>
§impl<K, V> Extend<(K, V)> for RecordingMap<K, V>where
K: Clone + Ord,
V: Clone,
impl<K, V> Extend<(K, V)> for RecordingMap<K, V>where K: Clone + Ord, V: Clone,
§fn extend<T>(&mut self, iter: T)where
T: IntoIterator<Item = (K, V)>,
fn extend<T>(&mut self, iter: T)where T: IntoIterator<Item = (K, V)>,
source§fn extend_one(&mut self, item: A)
fn extend_one(&mut self, item: A)
extend_one)source§fn extend_reserve(&mut self, additional: usize)
fn extend_reserve(&mut self, additional: usize)
extend_one)§impl<K, V> FromIterator<(K, V)> for RecordingMap<K, V>where
K: Clone + Ord,
V: Clone,
impl<K, V> FromIterator<(K, V)> for RecordingMap<K, V>where K: Clone + Ord, V: Clone,
§fn from_iter<T>(iter: T) -> RecordingMap<K, V>where
T: IntoIterator<Item = (K, V)>,
fn from_iter<T>(iter: T) -> RecordingMap<K, V>where T: IntoIterator<Item = (K, V)>,
§impl<K, V> IntoIterator for RecordingMap<K, V>where
K: Clone + Ord,
V: Clone,
impl<K, V> IntoIterator for RecordingMap<K, V>where K: Clone + Ord, V: Clone,
§impl<K, V> KvMap<K, V> for RecordingMap<K, V>where
K: Ord + Clone,
V: Clone,
impl<K, V> KvMap<K, V> for RecordingMap<K, V>where K: Ord + Clone, V: Clone,
§fn get(&self, key: &K) -> Option<&V>
fn get(&self, key: &K) -> Option<&V>
Returns a reference to the value associated with the given key if the value exists.
If the key is part of the initial data set, the key access is recorded.
§fn contains_key(&self, key: &K) -> bool
fn contains_key(&self, key: &K) -> bool
Returns a boolean to indicate whether the given key exists in the data set.
If the key is part of the initial data set, the key access is recorded.
§fn insert(&mut self, key: K, value: V) -> Option<V>
fn insert(&mut self, key: K, value: V) -> Option<V>
Inserts a key-value pair into the data set.
If the key already exists in the data set, the value is updated and the old value is returned.
§fn iter(&self) -> Box<dyn Iterator<Item = (&K, &V)> + '_, Global>
fn iter(&self) -> Box<dyn Iterator<Item = (&K, &V)> + '_, Global>
Returns an iterator over the key-value pairs in the data set.
fn is_empty(&self) -> bool
§impl<K, V> PartialEq<RecordingMap<K, V>> for RecordingMap<K, V>where
K: PartialEq<K>,
V: PartialEq<V>,
impl<K, V> PartialEq<RecordingMap<K, V>> for RecordingMap<K, V>where K: PartialEq<K>, V: PartialEq<V>,
§fn eq(&self, other: &RecordingMap<K, V>) -> bool
fn eq(&self, other: &RecordingMap<K, V>) -> bool
self and other values to be equal, and is used
by ==.