Skip to main content

Element

Enum Element 

Source
pub enum Element {
    Scalar(Value),
    Count(i64),
    Member(Value),
    Sum(i64),
    Progress(i64),
}
Expand description

A threshold element (CON-3801 element): a named element of a carrier that a threshold read observes being reached.

Variants§

§

Scalar(Value)

A bare scalar; only #t against bool is admitted.

§

Count(i64)

(count n): at least n addresses, against addrs.

§

Member(Value)

(member x): x present, against vals or entries.

§

Sum(i64)

(sum n): grow-only numeric events sum to at least n. Installation requires a mandatory nonnegative shape on their writer.

§

Progress(i64)

(progress n): the progress closure has reached position n.

Implementations§

Source§

impl Element

Source

pub fn wire(&self) -> String

The wire spelling of the element, for diagnostics.

Source

pub fn render(&self) -> Value

The element as a state value that round-trips the wire form: {"count":2}, {"member":"x"}, {"sum":10}, {"progress":3}, "fault", true.

Source

pub fn to_sexpr(&self) -> SExpr

The element in the canonical encoding of the clause.

Source

pub fn admitted_by(&self, carrier: &Carrier) -> bool

Whether the carrier admits this element (the typing table of CON-3801): count n against addrs; member x against vals or entries; sum n against nonnegative numeric entries (the writer shape is checked at installation); progress n against progress; a bare #t against bool. Faults are separate outcomes.

Source

pub fn le(&self, l: &L) -> bool

self ≤ σ: the element is reached by a carrier element.

Source

pub fn finite_read( &self, table: &Table, index: usize, projection: &Option<Projection>, ) -> bool

Source

pub fn le_with_post(&self, l: &L, post: &Post) -> bool

Source

pub fn le_display(&self, shown: &Value) -> bool

The element is reached by a closure head’s display (REQ-3808): the progress integer has reached n. Faults are checked separately. The closure heads have no summarising carrier, so their ⊤ and their position are read from the display, which is monotone as proved in SPEC-034 and SPEC-019 CON-1908.

Trait Implementations§

Source§

impl Clone for Element

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 Element

Source§

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

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

impl Eq for Element

Source§

impl PartialEq for Element

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 Element

Auto Trait Implementations§

§

impl Forget for Element

§

impl Freeze for Element

§

impl Move for Element

§

impl RefUnwindSafe for Element

§

impl Send for Element
where RawVecInner: Send, BoxRaw<Value>: Send,

§

impl Sync for Element
where RawVecInner: Sync, BoxRaw<Value>: Sync,

§

impl Unpin for Element
where *const u8 is !null: Unpin, Box<Value>: Unpin,

§

impl UnsafeUnpin for Element

§

impl UnwindSafe for Element
where RawVecInner: UnwindSafe, BoxRaw<Value>: UnwindSafe,

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.