pub struct Program {
pub ops: Vec<Op>,
}Expand description
A bounded, ordered list of reconstruction instructions.
Fields§
§ops: Vec<Op>Instructions, evaluated in order.
Implementations§
Source§impl Program
impl Program
Sourcepub fn analyze(
&self,
object_lens: &[u64],
channel_lens: &[u64],
limits: Limits,
) -> Result<(u64, CoverageMap)>
pub fn analyze( &self, object_lens: &[u64], channel_lens: &[u64], limits: Limits, ) -> Result<(u64, CoverageMap)>
Walk the program, validating instruction semantics and returning both the predicted output length and the coverage certificate, using only object and channel lengths (no byte materialization, no large allocation).
Sourcepub fn analyze_ops(
&self,
object_lens: &[u64],
channel_lens: &[u64],
limits: Limits,
) -> Result<Vec<u64>>
pub fn analyze_ops( &self, object_lens: &[u64], channel_lens: &[u64], limits: Limits, ) -> Result<Vec<u64>>
Walk the program and return the exact output length contributed by each instruction, in program order.
This is the op-indexed view of Program::analyze: per_op[i] is the
number of bytes instruction i produces (0 for bookkeeping ops such as
MARK_OFFSET), so per_op.iter().sum() == analyze(...).0. It applies the
same validation and overflow checks as analyze; no rejection is
relaxed. The optional observation index is checked against this view.
Sourcepub fn analyze_inputs(
&self,
objects: &[Vec<u8>],
channels: &[Vec<u8>],
limits: Limits,
) -> Result<(u64, CoverageMap)>
pub fn analyze_inputs( &self, objects: &[Vec<u8>], channels: &[Vec<u8>], limits: Limits, ) -> Result<(u64, CoverageMap)>
Analyze using concrete object and channel tables.
Sourcepub fn analyze_objects(
&self,
objects: &[Vec<u8>],
limits: Limits,
) -> Result<(u64, CoverageMap)>
pub fn analyze_objects( &self, objects: &[Vec<u8>], limits: Limits, ) -> Result<(u64, CoverageMap)>
Convenience wrapper over Program::analyze for a program with no
entropy channels.