MCPcopy Index your code
hub / github.com/AI45Lab/Code / ensure_valid

Method ensure_valid

core/src/program.rs:68–75  ·  view source on GitHub ↗
(&self)

Source from the content-addressed store, hash-verified

66 }
67
68 pub fn ensure_valid(&self) -> Result<()> {
69 let validation = self.validate();
70 if validation.is_valid() {
71 Ok(())
72 } else {
73 bail!("{}", validation.summary());
74 }
75 }
76
77 pub fn instantiate(&self, inputs: &serde_json::Value) -> Result<Program> {
78 self.ensure_valid()?;

Callers 2

instantiateMethod · 0.80
try_registerMethod · 0.80

Calls 2

is_validMethod · 0.80
validateMethod · 0.45

Tested by

no test coverage detected