pub enum AttachedReceipts {
Absent,
Malformed(&'static str),
Present(Vec<Vec<u8>>),
}Expand description
The receipts (394) header of a Signed Statement, as read.
The two states are kept apart on purpose. A statement that carries no
receipts header is unregistered as far as the presented bytes can show. A
statement whose header is present but unreadable is a different finding,
and a relying party that treats the second as the first has been told a
tampered or truncated envelope was merely never registered.
There is deliberately no method returning a single boolean over the set,
and no is_conforming. Which attached Receipts count is a function of which
Transparency Services the relying party trusts, and this type does not know
that.
Both states describe a header that was read. This type is only ever
produced by attached_receipts, so it cannot represent “the envelope was
never examined”. A caller that has not called attached_receipts holds no
value of this type at all, which is the distinction giskard09’s
negotiation_linkage invariant draws with an explicit None: never report
absence you did not look for.
Variants§
Absent
The statement carried no receipts header.
Malformed(&'static str)
The statement carried a receipts header that could not be read as an
array of Receipts. Carries the reason.
Present(Vec<Vec<u8>>)
One or more attached Receipts, in the priority order presented.
Implementations§
Source§impl AttachedReceipts
impl AttachedReceipts
Sourcepub fn as_slice(&self) -> &[Vec<u8>]
pub fn as_slice(&self) -> &[Vec<u8>]
The attached Receipts, or an empty slice in the Absent and
Malformed cases.
Callers deciding conformance must match on the variant rather than reach for this, because an empty slice here does not distinguish a statement that carried nothing from one whose header was unreadable.