diff --git a/schala-lib/src/language.rs b/schala-lib/src/language.rs index 06e36c3..6e84f03 100644 --- a/schala-lib/src/language.rs +++ b/schala-lib/src/language.rs @@ -1,5 +1,6 @@ extern crate colored; +use std::collections::HashMap; use self::colored::*; pub struct LLVMCodeString(pub String); @@ -51,6 +52,29 @@ impl LanguageOutput { } } +#[derive(Debug, Default)] +pub struct UnfinishedComputation { + artifacts: HashMap, +} + +#[derive(Debug)] +pub struct FinishedComputation { + artifacts: HashMap, + text_output: Result, +} + +impl UnfinishedComputation { + pub fn add_artifact(&mut self, artifact: TraceArtifact) { + self.artifacts.insert(artifact.stage_name.clone(), artifact); + } + pub fn output(self, output: Result) -> FinishedComputation { + FinishedComputation { + artifacts: self.artifacts, + text_output: output + } + } +} + /* //TODO I'll probably wanna implement this later #[derive(Debug)]