Skip to main content

ElementToken

Trait 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 StrategyField typeToken trait
setSet<V>UniqueElementToken<V>
isetISet<V>UniqueElementToken<V>
persistent_setSet<V>ElementToken<V> + Copy
persistent_isetISet<V>ElementToken<V> + Copy
multisetMultiset<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 is Copy.
  • For the multiset strategy, the tokens are neither unique nor Copy, as the specific multiplicity of each element must be exact.

To work with a collection of ElementTokens, use SetToken or MultisetToken.

Required Methods§

Source

spec fn instance_id(&self) -> InstanceId

Source

spec fn element(&self) -> Element

Source

proof fn arbitrary() -> tracked s : Self

Return an arbitrary token. It’s not possible to do anything interesting with this token because it doesn’t have a specified instance.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<K, V, Pred: InvariantPredicate<K, V>> ElementToken<()> for pending_reader<K, V, Pred>

Source§

impl<K, V, Pred: InvariantPredicate<K, V>> ElementToken<V> for reader<K, V, Pred>