tenferro_runtime/program/
import.rs1use std::fmt;
2
3use super::{ProgramBindings, ProgramValue, SemanticProgram};
4
5pub struct ProgramImport<'a> {
7 pub program: &'a SemanticProgram,
9 pub bindings: &'a ProgramBindings,
11 pub roots: &'a [ProgramValue],
13}
14
15impl fmt::Debug for ProgramImport<'_> {
16 fn fmt(&self, formatter: &mut fmt::Formatter<'_>) -> fmt::Result {
17 formatter
18 .debug_struct("ProgramImport")
19 .field("program_inputs", &self.program.inputs().len())
20 .field("program_outputs", &self.program.outputs().len())
21 .field("bindings", &self.bindings.len())
22 .field("roots", &self.roots.len())
23 .finish()
24 }
25}
26
27pub struct ImportedProgramValues {
29 roots: Box<[ProgramValue]>,
30}
31
32impl ImportedProgramValues {
33 pub(crate) fn new(roots: Box<[ProgramValue]>) -> Self {
34 Self { roots }
35 }
36
37 pub fn roots(&self) -> &[ProgramValue] {
39 &self.roots
40 }
41}
42
43impl fmt::Debug for ImportedProgramValues {
44 fn fmt(&self, formatter: &mut fmt::Formatter<'_>) -> fmt::Result {
45 formatter
46 .debug_struct("ImportedProgramValues")
47 .field("roots", &self.roots.len())
48 .finish()
49 }
50}