Trait vstd::tokens::ElementToken
source · pub trait ElementToken<Element>: Sized {
// Required methods
spec fn instance_id(&self) -> InstanceId;
spec fn element(&self) -> Element;
proof fn arbitrary() -> tracked s : Self;
}
Expand description
Interface for VerusSync tokens created for a field marked with the
set
, persistent_set
or multiset
strategies.
VerusSync Strategy | Field type | Token trait |
---|---|---|
set | Set<V> | UniqueElementToken<V> |
persistent_set | Set<V> | ElementToken<V> + Copy |
multiset | Multiset<V> | ElementToken<V> |
Each token represents a single element of the set or multiset.
- For the
set
strategy, the token for any given element is unique. - For the
persistent_set
strategy, the token for any given element is not unique, but isCopy
. - For the
multiset
strategy, the tokens are neither unique norCopy
, as the specific multiplicity of each element must be exact.
To work with a collection of ElementToken
s, use SetToken
or MultisetToken
.
Required Methods§
sourcespec fn instance_id(&self) -> InstanceId
spec fn instance_id(&self) -> InstanceId
Object Safety§
This trait is not object safe.