Skip to main content

Rule

Enum Rule 

Source
pub enum Rule {
Show 18 variants Context { path: Vec<String>, definition: Option<Box<Definition>>, }, Lift(Box<Lift>), BoundedCounter(Box<CounterRule>), LwwRegister { verb: String, key: String, clock: String, }, LwwPerSigner { verb: String, key: String, clock: String, }, LwwMap { verb: String, key: String, value: String, clock: String, delete: Option<String>, }, Initial { verb: String, key: String, }, Exists { verb: String, }, Count { verb: String, }, Progress { verb: String, }, Events { verb: String, key: String, }, SetUnion { verb: String, key: String, }, Values { verb: String, key: String, }, ValuesPerKey { verb: String, key: String, value: String, delete: Option<String>, }, ObservedSet { add: String, remove: String, key: String, }, Counter { inc: String, dec: String, key: String, }, Histogram { field: String, }, Sum { field: String, },
}
Expand description

One author-facing rule (SPEC-019 R.1). Defined by desugaring to the kernel (R.2); see fold.

Variants§

§

Context

Fields

§path: Vec<String>
§definition: Option<Box<Definition>>
§

Lift(Box<Lift>)

A finite lattice and contribution table verified at installation.

§

BoundedCounter(Box<CounterRule>)

§

LwwRegister

Clock-trusting last-writer-wins over domain-admitted writes.

Fields

§verb: String
§clock: String
§

LwwPerSigner

Own observed replacement, then clock arbitration among survivors.

Fields

§verb: String
§clock: String
§

LwwMap

Keyed observed replacement/deletion, then clock arbitration.

Fields

§verb: String
§value: String
§clock: String
§delete: Option<String>
§

Initial

Immutable field of the unique accepted opener; no arbitration.

Fields

§verb: String
§

Exists

Fields

§verb: String
§

Count

Fields

§verb: String
§

Progress

Greatest established position of a verb in its ordered protocol chain.

Fields

§verb: String
§

Events

Fields

§verb: String
§

SetUnion

Fields

§verb: String
§

Values

Fields

§verb: String
§

ValuesPerKey

Fields

§verb: String
§value: String
§delete: Option<String>
§

ObservedSet

Fields

§remove: String
§

Counter

Fields

§

Histogram

Fields

§field: String
§

Sum

Fields

§field: String

Implementations§

Source§

impl Rule

Source

pub fn head(&self) -> &'static str

The head symbol of this rule in the clause grammar.

Source

pub fn verbs(&self) -> Vec<&str>

Every performative this rule names.

Source

pub fn clock_field(&self) -> Option<(&str, &str)>

Declared clock evidence of an explicit LWW rule, if any.

Source

pub fn data_fields(&self) -> Vec<(&str, &str)>

Every (verb, key) pair this rule reads as data.

Source

pub fn replaces_verbs(&self) -> Vec<&str>

The verbs whose shape must carry the reserved :replaces field: writers and delete verbs of registers, signer writers, and observed-set removals.

Trait Implementations§

Source§

impl Clone for Rule

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Rule

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for Rule

Source§

impl PartialEq for Rule

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for Rule

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.