Skip to main content

MoonIr

Struct MoonIr 

Source
pub struct MoonIr {
Show 19 fields pub schema_version: u32, pub compiler_version: String, pub language_version: String, pub runtime_version: String, pub contracts: Vec<TypeDescriptor>, pub ledger: Vec<LedgerField>, pub witnesses: Vec<Witness>, pub natives: Vec<Native>, pub circuits: Vec<CircuitBody>, pub descriptors: IndexMap<String, TypeDescriptor>, pub constructor: Constructor, pub external_contracts: Vec<RuntimeValue>, pub pure_circuits: Vec<RuntimeValue>, pub frontend: Option<FrontendMeta>, pub debug_info: Option<DebugInfo>, pub capabilities: Option<CapabilitiesMeta>, pub workflows: Vec<WorkflowMeta>, pub privacy: Option<PrivacyMeta>, pub type_roles: IndexMap<String, SemanticTypeRole>,
}

Fields§

§schema_version: u32§compiler_version: String§language_version: String§runtime_version: String§contracts: Vec<TypeDescriptor>

Subcontract types the contract declares. A contract passed only as a circuit argument never reaches a ledger field, so this is the only record of its circuit signatures. Each entry is a TypeDescriptor::Contract.

§ledger: Vec<LedgerField>§witnesses: Vec<Witness>§natives: Vec<Native>§circuits: Vec<CircuitBody>§descriptors: IndexMap<String, TypeDescriptor>§constructor: Constructor§external_contracts: Vec<RuntimeValue>§pure_circuits: Vec<RuntimeValue>§frontend: Option<FrontendMeta>

Source frontend identification (schema v3, optional).

§debug_info: Option<DebugInfo>

Source file & span mapping for diagnostics and debugging (schema v3, optional).

§capabilities: Option<CapabilitiesMeta>

Governance and capability-model declarations (schema v3, optional).

§workflows: Vec<WorkflowMeta>

Multi-step workflow declarations such as Pact defpact (schema v3, optional).

§privacy: Option<PrivacyMeta>

Static privacy classification and circuit resource bounds (schema v3, optional).

§type_roles: IndexMap<String, SemanticTypeRole>

Semantic roles attached to descriptor keys for frontend-rich types lowered onto core IR primitives (schema v3, optional).

Implementations§

Source§

impl MoonIr

Source

pub fn new_v3( compiler_version: impl Into<String>, language_version: impl Into<String>, runtime_version: impl Into<String>, ) -> Self

Construct an empty schema-v3 MoonIr with default constructor and no optional metadata populated.

Source

pub fn with_frontend(self, frontend: FrontendMeta) -> Self

Source

pub fn with_debug_info(self, debug_info: DebugInfo) -> Self

Source

pub fn with_capabilities(self, capabilities: CapabilitiesMeta) -> Self

Source

pub fn with_workflows(self, workflows: Vec<WorkflowMeta>) -> Self

Source

pub fn with_privacy(self, privacy: PrivacyMeta) -> Self

Source

pub fn with_type_roles( self, type_roles: IndexMap<String, SemanticTypeRole>, ) -> Self

Source

pub fn with_type_role( self, descriptor_key: impl Into<String>, role: SemanticTypeRole, ) -> Self

Source

pub fn with_constructor(self, constructor: Constructor) -> Self

Source

pub fn add_ledger_field(&mut self, field: LedgerField) -> &mut Self

Source

pub fn add_witness(&mut self, witness: Witness) -> &mut Self

Source

pub fn add_native(&mut self, native: Native) -> &mut Self

Source

pub fn add_circuit(&mut self, circuit: CircuitBody) -> &mut Self

Source

pub fn add_descriptor( &mut self, key: impl Into<String>, descriptor: TypeDescriptor, ) -> &mut Self

Source

pub fn add_workflow(&mut self, workflow: WorkflowMeta) -> &mut Self

Trait Implementations§

Source§

impl Clone for MoonIr

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 MoonIr

Source§

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

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

impl<'de> Deserialize<'de> for MoonIr

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Serialize for MoonIr

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

§

impl Forget for MoonIr

§

impl Freeze for MoonIr

§

impl Move for MoonIr

§

impl RefUnwindSafe for MoonIr

§

impl Send for MoonIr
where RawVecInner: Send, BoxRaw<TypeDescriptor>: Send, NodeRef<Owned, String, RuntimeValue, LeafOrInternal>: Send, BoxRaw<(String, RuntimeValue)>: Send, BoxRaw<Expression>: Send, BoxRaw<Statement>: Send, RawTable<usize>: Send,

§

impl Sync for MoonIr
where RawVecInner: Sync, BoxRaw<TypeDescriptor>: Sync, NodeRef<Owned, String, RuntimeValue, LeafOrInternal>: Sync, BoxRaw<(String, RuntimeValue)>: Sync, BoxRaw<Expression>: Sync, BoxRaw<Statement>: Sync, RawTable<usize>: Sync,

§

impl Unpin for MoonIr

§

impl UnsafeUnpin for MoonIr
where *const u8 is !null: UnsafeUnpin, PhantomData<u8>: UnsafeUnpin, PhantomData<TypeDescriptor>: UnsafeUnpin, PhantomData<LedgerField>: UnsafeUnpin, PhantomData<Witness>: UnsafeUnpin, PhantomData<Native>: UnsafeUnpin, PhantomData<CircuitBody>: UnsafeUnpin, PhantomData<usize>: UnsafeUnpin, PhantomData<Bucket<String, TypeDescriptor>>: UnsafeUnpin, PhantomData<Argument>: UnsafeUnpin, PhantomData<RuntimeValue>: UnsafeUnpin, *const LeafNode<String, RuntimeValue> is !null: UnsafeUnpin, PhantomData<(Owned, LeafOrInternal)>: UnsafeUnpin, PhantomData<Box<(String, RuntimeValue)>>: UnsafeUnpin, *const Expression is !null: UnsafeUnpin, PhantomData<Expression>: UnsafeUnpin, PhantomData<StateValue>: UnsafeUnpin, PhantomData<MapEntry>: UnsafeUnpin, PhantomData<String>: UnsafeUnpin, PhantomData<Statement>: UnsafeUnpin, *const TypeDescriptor is !null: UnsafeUnpin, PhantomData<StructField>: UnsafeUnpin, PhantomData<ContractCircuitSig>: UnsafeUnpin, PhantomData<TupleItem>: UnsafeUnpin, PhantomData<VmInstr>: UnsafeUnpin, PhantomData<PathElement>: UnsafeUnpin, *const Statement is !null: UnsafeUnpin, PhantomData<BindingTarget>: UnsafeUnpin, PhantomData<Bucket<String, String>>: UnsafeUnpin, PhantomData<Bucket<String, SourceSpan>>: UnsafeUnpin, PhantomData<CapabilityDef>: UnsafeUnpin, PhantomData<Bucket<String, CircuitCapUsage>>: UnsafeUnpin, PhantomData<WorkflowMeta>: UnsafeUnpin, PhantomData<Bucket<String, PrivacyClass>>: UnsafeUnpin, PhantomData<Bucket<String, FieldRole>>: UnsafeUnpin, PhantomData<Bucket<String, CircuitBoundsMeta>>: UnsafeUnpin, PhantomData<Bucket<String, SemanticTypeRole>>: UnsafeUnpin,

§

impl UnwindSafe for MoonIr

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<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

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> 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.