Trait vstd::tokens::KeyValueToken
source · pub trait KeyValueToken<Key, Value>: Sized {
// Required methods
spec fn instance_id(&self) -> InstanceId;
spec fn key(&self) -> Key;
spec fn value(&self) -> Value;
proof fn agree(tracked &self, tracked other: &Self);
proof fn arbitrary() -> tracked s : Self;
}
Expand description
Interface for VerusSync tokens created for a field marked with the
map
or persistent_map
strategies.
VerusSync Strategy | Field type | Token trait |
---|---|---|
map | Map<K, V> | UniqueKeyValueToken<K, V> |
persistent_map | Map<K, V> | KeyValueToken<V> + Copy |
For the cases where the tokens are not Copy
, then token is necessarily unique
per-instance, per-key; the sub-trait, UniqueKeyValueToken<V>
, provides
an additional lemma to prove uniqueness.
Each token represents a single key-value pair.
To work with a collection of KeyValueToken
s, use MapToken
.
Required Methods§
sourcespec fn instance_id(&self) -> InstanceId
spec fn instance_id(&self) -> InstanceId
Object Safety§
This trait is not object safe.