This reference describes unreleased code on main; no release documents it yet.

rlmesh::adapters::ModelSpec

structPreviewuse rlmesh::adapters::ModelSpec;[source]

A validated immutable model input tree and action layout.

struct ModelSpec

new

associated function[source]
fn new(input: impl Into<InputNode>, output: Action) -> Result<Self>

Construct and validate a model spec from its input and action declarations.

from_dict

associated function[source]
fn from_dict(data: &Metadata) -> Result<Self>

Read and validate a typed metadata representation.

from_json

associated function[source]
fn from_json(payload: &str) -> Result<Self>

Read and validate a JSON representation.

from_metadata

associated function[source]
fn from_metadata(metadata: &Metadata) -> Result<Option<Self>>

Read the versioned metadata key; absent or None yields None.

input

method[source]
fn input(&self) -> &InputNode

The authored immutable model input tree.

output

method[source]
fn output(&self) -> &Action

The authored model action layout.

to_dict

method[source]
fn to_dict(&self) -> Result<Metadata>

Validate and serialize to canonical typed metadata.

to_json

method[source]
fn to_json(&self) -> Result<String>

Serialize to canonical compact, sorted UTF-8 JSON.

to_metadata

method[source]
fn to_metadata(&self) -> Result<Metadata>

The fragment to merge into contract metadata.

Trait implementations

  • impl Clone for ModelSpec
  • impl Debug for ModelSpec
  • impl StructuralPartialEq for ModelSpec
  • impl PartialEq for ModelSpec
  • impl Display for ModelSpec
  • impl From<ModelSpec> for SpecArg