pub struct ArtifactHeader {
pub version: u16,
pub generation_label: String,
pub source: String,
pub endian_policy: EndianPolicy,
pub profile: ArtifactProfile,
}Expand description
Describes the non-body metadata stored in a compressed artifact.
Fields§
§version: u16Format version.
generation_label: StringHuman-readable generation label.
source: StringHuman-readable provenance/source summary.
endian_policy: EndianPolicyExplicit byte-order policy for the stored numeric fields.
profile: ArtifactProfileArtifact capability profile describing stored, derived, and unsupported outputs.
Implementations§
Source§impl ArtifactHeader
impl ArtifactHeader
Sourcepub fn new(
generation_label: impl Into<String>,
source: impl Into<String>,
) -> Self
pub fn new( generation_label: impl Into<String>, source: impl Into<String>, ) -> Self
Creates a new header using the current artifact version, an explicit little-endian byte-order policy, and a conservative profile that stores only ecliptic longitude/latitude/distance channels (with equatorial coordinates and motion derived, and apparent/topocentric/sidereal outputs unsupported).
Sourcepub fn with_profile(
generation_label: impl Into<String>,
source: impl Into<String>,
profile: ArtifactProfile,
) -> Self
pub fn with_profile( generation_label: impl Into<String>, source: impl Into<String>, profile: ArtifactProfile, ) -> Self
Creates a new header using the current artifact version, an explicit little-endian byte-order policy, and an explicit profile.
Sourcepub fn with_profile_and_endian(
generation_label: impl Into<String>,
source: impl Into<String>,
endian_policy: EndianPolicy,
profile: ArtifactProfile,
) -> Self
pub fn with_profile_and_endian( generation_label: impl Into<String>, source: impl Into<String>, endian_policy: EndianPolicy, profile: ArtifactProfile, ) -> Self
Creates a new header with an explicit byte-order policy and profile.
Sourcepub fn summary(&self) -> String
pub fn summary(&self) -> String
Returns a compact one-line summary of the byte order and capability profile encoded by this header.
Sourcepub fn summary_line(&self) -> String
pub fn summary_line(&self) -> String
Returns a compact one-line summary of the byte order and capability profile encoded by this header.
Sourcepub fn validate(&self) -> Result<(), CompressionError>
pub fn validate(&self) -> Result<(), CompressionError>
Validates that the header’s version and provenance fields are populated with canonical, non-whitespace-padded text.
The codec already enforces these checks at encode/decode time, but exposing the validation step directly lets artifact generators and release tooling fail before writing or reusing an invalid header.
Sourcepub fn summary_for_body_count(&self, body_count: usize) -> String
pub fn summary_for_body_count(&self, body_count: usize) -> String
Returns the header summary annotated with how many bodies share it.