Skip to main content

Module capture

Module capture 

Source
Expand description

Runtime reader for the ironprint.json fingerprint embedded in the binary.

The companion build module (feature dependency-graph-build) writes ironprint.json to $OUT_DIR at compile time. The downstream binary embeds it with:

const IRONPRINT: &str = include_str!(concat!(env!("OUT_DIR"), "/ironprint.json"));

§Functions

  • parse — deserialises the embedded JSON into a typed IronprintData struct. Returns CaptureError if the JSON is malformed or a required section is absent.
  • as_bytes — returns the raw JSON bytes. Because the JSON is normalised and sorted at build time, the returned bytes are stable and deterministic across equivalent builds.

§Concerns

  • The data is a read-only snapshot fixed at compile time. It reflects the build environment at the time of compilation, not the current runtime state.
  • The fingerprint resides as plain text in the binary’s read-only data section. It is neither encrypted nor obfuscated and is visible to anyone with access to the binary.

Structs§

BuildInfo
Build environment section.
IronprintData
Parsed contents of ironprint.json.
PackageInfo
Package identity section.

Enums§

CaptureError
Errors that can occur while reading a captured ironprint.

Functions§

as_bytes
Return the raw bytes of the ironprint JSON string.
parse
Parse the embedded ironprint JSON into a typed IronprintData.