pub struct StreamResponseExt {
pub error: Option<StreamError>,
}Expand description
Optional StreamResponse extension fields, carried as trailing bytes after
the StreamResponse message via the two-phase pattern (ADR 013 §Tier 1; see
encode_stream_response / parse_stream_response_ext).
Nothing here is covered by slash_sig. New fields are appended to the END
and MUST be Option<T> or have a meaningful Default; insertions and
reordering are Tier-3.
Fields§
§error: Option<StreamError>Open-time refusal class when body.ok == false (NotFound,
Declined, Unfunded).
Unsigned and informational. VoucherRejected never rides here — it is
delivered mid-stream via ClientMessage::StreamError.
Its agreement with the signed body.ok is a cross-half invariant, so it
is checked by StreamResponseExt::validate, which takes ok — the
base-only StreamResponse::validate cannot see this field.
Implementations§
Source§impl StreamResponseExt
impl StreamResponseExt
Sourcepub const fn validate(&self, ok: bool) -> Result<(), MessageValidationError>
pub const fn validate(&self, ok: bool) -> Result<(), MessageValidationError>
Check the unsigned half against the signed ok flag (ADR 005
§cdn/client/v1): ok == true ⇒ no error; ok == false ⇒ exactly one
delivery-side error, never the mid-stream-only
StreamError::VoucherRejected.
Separate from parsing so forward-compatible trailing bytes do not couple
to value checks, and separate from StreamResponse::validate because
the rule spans the frozen base and the extension — a receiver holds both
and must call each.
§Errors
MessageValidationError::StreamErrorWithOk,
MessageValidationError::MissingStreamError, or
MessageValidationError::VoucherRejectedInResponse.