Skip to main content

Dialect

Struct Dialect 

Source
pub struct Dialect {
Show 16 fields pub types: BTreeMap<String, SExpr>, pub name: String, pub extends: Vec<String>, pub author: Option<String>, pub performatives: Vec<PerformativeDef>, pub resources: ResourceBounds, pub examples: Vec<SExpr>, pub signature: Option<Vec<u8>>, pub hash: Option<String>, pub protocol: Option<String>, pub causal_protocol: Option<CausalProtocol>, pub shapes: Vec<ShapeConstraint>, pub roles: Vec<RoleDecl>, pub causal_locality: CausalLocality, pub state: Option<StateClause>, pub state_bounds: Option<StateBounds>,
}
Expand description

A CBCL dialect (REQ-022).

Mirrors CBCL.Dialect in Dialect.lean:34–44.

Fields§

§types: BTreeMap<String, SExpr>§name: String§extends: Vec<String>

Parent dialect names (Lean: extends_ : List String).

§author: Option<String>§performatives: Vec<PerformativeDef>§resources: ResourceBounds§examples: Vec<SExpr>§signature: Option<Vec<u8>>§hash: Option<String>

Canonical content hash, f1220<lowercase-hex64> over crate::canonical::dialect_canonical_bytes (SPEC-014 REQ-628).

Invariant: every dialect installed into a DialectRegistry has Some(..) — installation computes the hash when this is None. A pre-declared hash (e.g. a :hash clause in dialect source) is preserved verbatim so wrappers can compare the claim against the computed value and reject mismatches.

§protocol: Option<String>§causal_protocol: Option<CausalProtocol>

Causal protocol declaration (REQ-200, REQ-201).

§shapes: Vec<ShapeConstraint>

Shape constraints for expanded messages (REQ-220).

§roles: Vec<RoleDecl>

Declared roles (SPEC-014 REQ-621, CON-600); empty = role-free dialect.

§causal_locality: CausalLocality

(:causal-locality derive|reject) (SPEC-015 REQ-709, ADR-704): under Derive, R6(vi) failures compile into the recorded envelope-routing table instead of rejecting; the default Reject preserves v1 semantics bit-for-bit.

§state: Option<StateClause>

(state …) clause (SPEC-019 REQ-1902); None = no state layer.

§state_bounds: Option<StateBounds>

(:state-bounds …) (SPEC-019 REQ-1904); None = the defaults.

Implementations§

Source§

impl Dialect

Source

pub fn defines_performative(&self, name: &str) -> bool

Check if this dialect defines a performative with the given name (REQ-025).

Source

pub fn find_performative(&self, name: &str) -> Option<&PerformativeDef>

Find a performative definition by name (REQ-025).

Source

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

Return the names of all performatives in this dialect.

Trait Implementations§

Source§

impl Clone for Dialect

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 Dialect

Source§

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

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

impl Eq for Dialect

Source§

impl PartialEq for Dialect

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 Dialect

Auto Trait Implementations§

§

impl Forget for Dialect

§

impl Freeze for Dialect

§

impl Move for Dialect

§

impl RefUnwindSafe for Dialect

§

impl Send for Dialect
where NodeRef<Owned, String, SExpr, LeafOrInternal>: Send, BoxRaw<(String, SExpr)>: Send, RawVecInner: Send, NodeRef<Owned, String, SetValZST, LeafOrInternal>: Send, BoxRaw<(String, SetValZST)>: Send, NodeRef<Owned, String, StepDecl, LeafOrInternal>: Send, BoxRaw<(String, StepDecl)>: Send, Arc<Node>: Send, NodeRef<Owned, String, BTreeSet<String>, LeafOrInternal>: Send, BoxRaw<(String, BTreeSet<String>)>: Send, BoxRaw<Definition>: Send, BoxRaw<Lift>: Send, BoxRaw<CounterRule>: Send, BoxRaw<Value>: Send,

§

impl Sync for Dialect
where NodeRef<Owned, String, SExpr, LeafOrInternal>: Sync, BoxRaw<(String, SExpr)>: Sync, RawVecInner: Sync, NodeRef<Owned, String, SetValZST, LeafOrInternal>: Sync, BoxRaw<(String, SetValZST)>: Sync, NodeRef<Owned, String, StepDecl, LeafOrInternal>: Sync, BoxRaw<(String, StepDecl)>: Sync, Arc<Node>: Sync, NodeRef<Owned, String, BTreeSet<String>, LeafOrInternal>: Sync, BoxRaw<(String, BTreeSet<String>)>: Sync, BoxRaw<Definition>: Sync, BoxRaw<Lift>: Sync, BoxRaw<CounterRule>: Sync, BoxRaw<Value>: Sync,

§

impl Unpin for Dialect
where *const LeafNode<String, SExpr> is !null: Unpin, Box<(String, SExpr)>: Unpin, *const u8 is !null: Unpin, *const LeafNode<String, SetValZST> is !null: Unpin, Box<(String, SetValZST)>: Unpin, *const LeafNode<String, StepDecl> is !null: Unpin, Box<(String, StepDecl)>: Unpin, Arc<Node>: Unpin, *const LeafNode<String, BTreeSet<String>> is !null: Unpin, Box<(String, BTreeSet<String>)>: Unpin, Box<Definition>: Unpin, Box<Lift>: Unpin, Box<CounterRule>: Unpin, Box<Value>: Unpin,

§

impl UnsafeUnpin for Dialect

§

impl UnwindSafe for Dialect

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.