pub struct ChecksumConfig {
pub name_template: Option<String>,
pub algorithm: Option<String>,
pub skip: Option<StringOrBool>,
pub extra_files: Option<Vec<ExtraFileSpec>>,
pub templated_extra_files: Option<Vec<TemplatedExtraFile>>,
pub ids: Option<Vec<String>>,
pub split: Option<bool>,
pub split_format: Option<ChecksumSplitFormat>,
}Fields§
§name_template: Option<String>Checksum filename template (default: “{{ ProjectName }}_{{ Version }}_checksums.txt”).
algorithm: Option<String>Hash algorithm (default: sha256). Accepted values: sha1, sha224,
sha256, sha384, sha512, sha3-224, sha3-256, sha3-384,
sha3-512, blake2b, blake2s, blake3, crc32, md5. An
unrecognized value is rejected at checksum-stage entry. The authoritative
set is ChecksumConfig::SUPPORTED_ALGORITHMS.
skip: Option<StringOrBool>Disable checksums. Accepts bool or template string.
Accepts the legacy disable: spelling via serde alias for back-compat.
extra_files: Option<Vec<ExtraFileSpec>>Extra files to include in the checksum file (beyond build artifacts).
templated_extra_files: Option<Vec<TemplatedExtraFile>>Extra files whose contents are rendered through the template engine before inclusion.
Unlike extra_files which copy as-is, template variables like {{ Tag }} are expanded.
ids: Option<Vec<String>>Build IDs filter: only checksum artifacts from builds whose id is in this list.
split: Option<bool>When true, produce one checksum file per artifact instead of a combined file.
split_format: Option<ChecksumSplitFormat>Sidecar content format when split: true (default: bare). Set to
coreutils to write <hash> <filename> so each sidecar verifies with
shasum -c. Ignored in combined mode (the combined file is always
coreutils-format).
Implementations§
Source§impl ChecksumConfig
impl ChecksumConfig
Sourcepub const DEFAULT_NAME_TEMPLATE: &'static str = "{{ ProjectName }}_{{ Version }}_checksums.txt"
pub const DEFAULT_NAME_TEMPLATE: &'static str = "{{ ProjectName }}_{{ Version }}_checksums.txt"
Default checksum filename template (combined mode). Mirrors the checksums config.
Sourcepub const DEFAULT_ALGORITHM: &'static str = "sha256"
pub const DEFAULT_ALGORITHM: &'static str = "sha256"
Default hash algorithm (sha256).
Sourcepub const SUPPORTED_ALGORITHMS: &'static [&'static str]
pub const SUPPORTED_ALGORITHMS: &'static [&'static str]
The closed set of accepted Self::algorithm values. This is the
authoritative list the checksum stage’s hash dispatch and
validate_algorithm are kept in sync with (a stage-checksum
drift-guard test asserts the two never diverge), so the config rustdoc
can name the full set without hand-copying a list that rots.
Sourcepub fn resolved_algorithm(&self) -> &str
pub fn resolved_algorithm(&self) -> &str
Resolve the hash algorithm, falling back to the project default
when the user did not specify one. Stages MUST call this rather
than reading self.algorithm directly, so a future default change
(or user-facing override resolution) lands in one place.
Sourcepub fn resolved_split(&self) -> bool
pub fn resolved_split(&self) -> bool
Whether split-mode (one sidecar per artifact) is requested.
Defaults to false (combined-file mode).
Sourcepub fn resolved_combined_name_template(&self) -> &str
pub fn resolved_combined_name_template(&self) -> &str
Resolve the combined-mode checksum filename template, falling back to the canonical default. Returns the raw template string; the caller still renders it through Tera.
Split mode constructs sidecar names per-artifact at the call site
(<artifact>.<algo> literal format) and intentionally does NOT
route through this accessor — that path needs no template rendering.
Sourcepub fn resolve_combined_name_template<'a>(
crate_checksum: Option<&'a ChecksumConfig>,
global_checksum: Option<&'a ChecksumConfig>,
) -> &'a str
pub fn resolve_combined_name_template<'a>( crate_checksum: Option<&'a ChecksumConfig>, global_checksum: Option<&'a ChecksumConfig>, ) -> &'a str
Resolve the combined-checksums name_template for a crate, applying the
canonical precedence — the crate’s own checksum.name_template, then the
global defaults.checksum.name_template, then Self::DEFAULT_NAME_TEMPLATE.
The single source of truth shared by the checksum stage (which writes the
file) and the install-script stage (which references it in the generated
install.sh), so the two can never derive different names.
Trait Implementations§
Source§impl Clone for ChecksumConfig
impl Clone for ChecksumConfig
Source§fn clone(&self) -> ChecksumConfig
fn clone(&self) -> ChecksumConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ChecksumConfig
impl Debug for ChecksumConfig
Source§impl Default for ChecksumConfig
impl Default for ChecksumConfig
Source§fn default() -> ChecksumConfig
fn default() -> ChecksumConfig
Source§impl<'de> Deserialize<'de> for ChecksumConfigwhere
ChecksumConfig: Default,
impl<'de> Deserialize<'de> for ChecksumConfigwhere
ChecksumConfig: Default,
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl JsonSchema for ChecksumConfig
impl JsonSchema for ChecksumConfig
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
$ref keyword. Read more