Skip to main content

printobserver_types/
image.rs

1//! The handle an image travels in context under.
2//!
3//! The record of an image — where it was fetched from, how many bytes it is,
4//! where it lives — is the supervision domain's own; what every domain and
5//! every client must agree on is only how an image is named on the envelope,
6//! and that is this.
7
8use schemars::JsonSchema;
9use serde::{Deserialize, Serialize};
10
11use crate::ids::ImageId;
12
13/// The handle an image travels in context under.
14#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, JsonSchema)]
15#[serde(deny_unknown_fields)]
16pub struct ImageRef {
17    /// The image's identifier.
18    pub id: ImageId,
19    /// The SHA-256 of its bytes, lowercase hexadecimal.
20    pub sha256: String,
21}