pub struct AttestedComputation {
pub runtime: Option<String>,
pub parameters: Vec<Parameter>,
pub computation: ComputationSource,
pub executor: Option<Executor>,
pub attester: Option<Attester>,
pub has_redundant_inline: bool,
}Expand description
The contract of an Attested Computation concept: its top-level frontmatter
plus the computation itself.
Fields§
§runtime: Option<String>REQUIRED for this type: how to run the computation, and so how the
executor and attester interpret it and what parameters mean.
parameters: Vec<Parameter>The typed, named holes an agent may fill.
computation: ComputationSourceThe sanctioned computation, inline or by path.
executor: Option<Executor>How the computation is run.
attester: Option<Attester>The deterministic check over a run’s receipt.
has_redundant_inline: booltrue when the body carries a # Computation block and the
computation key names a file. The spec asks for one or the other, so this
flags a contract whose two halves may disagree.
Implementations§
Source§impl AttestedComputation
impl AttestedComputation
Sourcepub fn from_parts(frontmatter: &Frontmatter, body: &str) -> Self
pub fn from_parts(frontmatter: &Frontmatter, body: &str) -> Self
Reads the contract from a concept’s frontmatter and body.
This does not check that the concept’s type is
ATTESTED_COMPUTATION_TYPE, since the computation keys are ordinary
frontmatter and a producer may use them on another type. Use
Frontmatter::is_attested_computation
to test the type.
Sourcepub fn required_parameters(&self) -> impl Iterator<Item = &Parameter>
pub fn required_parameters(&self) -> impl Iterator<Item = &Parameter>
The parameters an agent must supply a value for.
Sourcepub fn path_fields(&self) -> Vec<(&'static str, &str)>
pub fn path_fields(&self) -> Vec<(&'static str, &str)>
The path-valued fields of this contract, as (field name, raw path)
pairs, the inputs to links::field_path_candidates when checking
that a contract points at something real.
Trait Implementations§
Source§impl Clone for AttestedComputation
impl Clone for AttestedComputation
Source§fn clone(&self) -> AttestedComputation
fn clone(&self) -> AttestedComputation
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more