pub struct PinnedRelease {
pub version: String,
pub build_id: String,
pub sha256: HashMap<Platform, String>,
}Expand description
A concrete hyperd release pinned to a specific version and build, with
optional per-platform SHA-256 checksums.
The “built-in” pin shipped with the crate lives in
hyperd-bootstrap/hyperd-version.toml and is available via
PinnedRelease::builtin. Callers can override it by loading an
external TOML file (see PinnedRelease::from_toml_file) or by passing
a literal TOML string to PinnedRelease::from_toml_str.
Fields§
§version: StringUpstream release version (for example, "0.0.24457").
build_id: StringUpstream build identifier suffix (for example, "rc36858b6").
sha256: HashMap<Platform, String>Expected SHA-256 digests keyed by platform. Empty strings are treated as “no digest” so that partially-filled tables skip verification for the missing targets instead of failing outright.
Implementations§
Source§impl PinnedRelease
impl PinnedRelease
Sourcepub fn builtin() -> Self
pub fn builtin() -> Self
Returns the PinnedRelease baked into the crate at build time.
§Panics
Panics if the shipped hyperd-version.toml fails to parse. This is
treated as a programmer error — the file is validated by the build
script and release CI.
Sourcepub fn from_toml_str(s: &str) -> Result<Self, Error>
pub fn from_toml_str(s: &str) -> Result<Self, Error>
Parses a PinnedRelease from an in-memory TOML string.
§Errors
Returns Error::TomlParse if the text is not valid TOML or the
document does not match the PinnedRelease schema.
Sourcepub fn from_toml_file(path: &Path) -> Result<Self, Error>
pub fn from_toml_file(path: &Path) -> Result<Self, Error>
Loads a PinnedRelease from a TOML file on disk.
§Errors
Returns Error::Io if the file cannot be read, or
Error::TomlParse if the content is not a valid PinnedRelease.
Sourcepub fn sha256_for(&self, platform: Platform) -> Option<&str>
pub fn sha256_for(&self, platform: Platform) -> Option<&str>
Returns the expected SHA-256 digest for platform, or None if the
release metadata does not pin a digest for that platform. Empty
strings (common in pre-release metadata) are treated as absent.
Sourcepub fn version_tag(&self) -> String
pub fn version_tag(&self) -> String
Returns the full Hyper release tag — version.build_id — used in
download URLs and install directory names.
Trait Implementations§
Source§impl Clone for PinnedRelease
impl Clone for PinnedRelease
Source§fn clone(&self) -> PinnedRelease
fn clone(&self) -> PinnedRelease
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more