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
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.
LwwPerSigner
Own observed replacement, then clock arbitration among survivors.
LwwMap
Keyed observed replacement/deletion, then clock arbitration.
Initial
Immutable field of the unique accepted opener; no arbitration.
Exists
Count
Progress
Greatest established position of a verb in its ordered protocol chain.
Events
SetUnion
Values
ValuesPerKey
ObservedSet
Counter
Histogram
Sum
Implementations§
Source§impl Rule
impl Rule
Sourcepub fn clock_field(&self) -> Option<(&str, &str)>
pub fn clock_field(&self) -> Option<(&str, &str)>
Declared clock evidence of an explicit LWW rule, if any.
Sourcepub fn data_fields(&self) -> Vec<(&str, &str)>
pub fn data_fields(&self) -> Vec<(&str, &str)>
Every (verb, key) pair this rule reads as data.
Sourcepub fn replaces_verbs(&self) -> Vec<&str>
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§
impl Eq for Rule
impl StructuralPartialEq for Rule
Auto Trait Implementations§
impl Forget for Rule
impl Freeze for Rulewhere
*const u8 is !null: Freeze,
PhantomData<String>: Freeze,
*const Definition is !null: Freeze,
PhantomData<Definition>: Freeze,
*const Lift is !null: Freeze,
PhantomData<Lift>: Freeze,
*const CounterRule is !null: Freeze,
PhantomData<CounterRule>: Freeze,
PhantomData<u8>: Freeze,
impl Move for Rule
impl RefUnwindSafe for Rule
impl Send for Rule
impl Sync for Rule
impl Unpin for Rule
impl UnsafeUnpin for Rulewhere
*const u8 is !null: UnsafeUnpin,
PhantomData<String>: UnsafeUnpin,
*const Definition is !null: UnsafeUnpin,
PhantomData<Definition>: UnsafeUnpin,
*const Lift is !null: UnsafeUnpin,
PhantomData<Lift>: UnsafeUnpin,
*const CounterRule is !null: UnsafeUnpin,
PhantomData<CounterRule>: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
impl UnwindSafe for Rulewhere
RawVecInner: UnwindSafe,
BoxRaw<Definition>: UnwindSafe,
BoxRaw<Lift>: UnwindSafe,
BoxRaw<CounterRule>: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more