pub struct LineIndex {
pub line: String,
pub counter: u64,
pub issued_at: String,
pub layers: Vec<IndexedLayer>,
}Expand description
What the realm says a line contains.
Fields§
§line: StringThe release line, e.g. “2026.08”.
counter: u64Monotonic per-line document counter — a stale index must not silently replace a newer one, exactly as for line-status.
issued_at: StringRFC 3339 issue time of this document.
layers: Vec<IndexedLayer>Every layer of this line, in publication order.
Implementations§
Source§impl LineIndex
impl LineIndex
Sourcepub fn verify_and_parse(
envelope: &[u8],
root_public_key: &[u8],
) -> Result<Self, IndexError>
pub fn verify_and_parse( envelope: &[u8], root_public_key: &[u8], ) -> Result<Self, IndexError>
Verify an envelope against the realm’s trust root and parse it.
Sourcepub fn sign(
&self,
secret_key: &[u8],
key_id: &str,
) -> Result<String, IndexError>
pub fn sign( &self, secret_key: &[u8], key_id: &str, ) -> Result<String, IndexError>
Sign an index (the producing side — CI, beside deposit).
Sourcepub fn line(&self) -> Result<Line, IndexError>
pub fn line(&self) -> Result<Line, IndexError>
The line this document is about.
Sourcepub fn refuse_omission(&self, served: &[String]) -> Result<(), IndexError>
pub fn refuse_omission(&self, served: &[String]) -> Result<(), IndexError>
Clause 3: every layer the index names must be present in what the
source actually offers. served is the set of layer ids the source
enumerated. Returns the FIRST omission, named — not a boolean, because
an error a user cannot act on is not a check.
Sourcepub fn high_water(&self) -> Option<u64>
pub fn high_water(&self) -> Option<u64>
Clause 4: the high-water mark this index justifies, independent of what the source chose to serve. A registry that hides the newest layer must not thereby lower the bar a later install has to clear, which is the whole point of authenticating the listing.
The greatest counter the realm asserts for this line. None for an
empty index, which asserts nothing and must not be mistaken for a mark
of zero.
Sourcepub fn refuse_regression(
&self,
cached: Option<&LineIndex>,
) -> Result<(), IndexError>
pub fn refuse_regression( &self, cached: Option<&LineIndex>, ) -> Result<(), IndexError>
Clause 2: refuse a presented index older than one already held.
Equality is allowed — a CI re-run must stay idempotent, the same rule
attach_envelope_to_layout follows for line-status.