#[non_exhaustive]pub struct ChainBreak {
pub rtype: String,
pub id: String,
pub version_id: i64,
pub algorithm: &'static str,
pub detail: String,
}Expand description
A break in one resource’s hash chain (spec M3.16, M3.16a).
One break per algorithm, never merged: a regime that recognises only
SHA-3 must be able to see the SHA-3 verdict on its own, and a break that
appears under one algorithm but not the other is itself worth seeing —
it means the stored digests disagree about the same bytes.
#[non_exhaustive] so that a future algorithm or field is a patch, not a
break: adding a public field to a struct callers can build or destructure
exhaustively is a breaking change, and this type gained algorithm
exactly that way.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.rtype: String§id: String§version_id: i64§algorithm: &'static str"sha256" or "sha3-256".
detail: StringImplementations§
Source§impl ChainBreak
impl ChainBreak
Sourcepub fn new(
rtype: impl Into<String>,
id: impl Into<String>,
version_id: i64,
algorithm: &'static str,
detail: impl Into<String>,
) -> Self
pub fn new( rtype: impl Into<String>, id: impl Into<String>, version_id: i64, algorithm: &'static str, detail: impl Into<String>, ) -> Self
Record a break.
A constructor rather than a struct literal because this type is
#[non_exhaustive]: it gained algorithm after release, and keeping
that freedom is the point. A literal can only be written inside this
crate, and the ports that detect breaks are outside it, so without this
they would have to choose between constructing the type and keeping the
guarantee.