pub struct Response {
pub schema: ResponseTag,
pub definition: DefinitionId,
pub instance: InstanceId,
pub revision: Revision,
pub values: Vec<Submission>,
pub idempotency_key: IdempotencyKey,
pub responder_provenance: ResponderProvenance,
}Expand description
A submission bound to the exact offer it answers.
Binds type, definition, instance, digest, revision, control values, idempotency key, and responder provenance — the ADR’s own list. Nothing here authorizes on its own: the controller revalidates every field against the definition before it resolves anything.
Fields§
§schema: ResponseTagVersioned type tag; see RESPONSE_SCHEMA_V1.
definition: DefinitionIdThe definition answered — and, being a content id, its exact form digest. A definition that changed by one byte cannot be answered by a response minted against the old one.
instance: InstanceIdThe instance answered.
revision: RevisionThe revision the responder saw.
values: Vec<Submission>The submitted values, each against the control it answers.
idempotency_key: IdempotencyKeyMakes a retry the same submission rather than a second one.
responder_provenance: ResponderProvenanceHow the responder was authenticated, by reference — including which audience they answered from. Bound into the response’s identity, so a submission cannot be re-attributed after the fact.
There is deliberately no second responder: Audience field beside
this one. Two bound fields carrying the same fact can disagree, and
nothing in a plain record keeps them equal; the identity table would
then be pinning a contradiction. The audience a responder was
authenticated FROM is part of the assertion, so it lives with it.
Implementations§
Source§impl Response
impl Response
Sourcepub fn response_id(&self) -> Result<ResponseId, ProtocolError>
pub fn response_id(&self) -> Result<ResponseId, ProtocolError>
Sourcepub fn schema_tag(&self) -> &'static str
pub fn schema_tag(&self) -> &'static str
The schema tag, as a string.
Reading it needs no check: the tag is a TYPE that deserializes from
exactly one value, so a record of this type cannot carry any other
one. What used to be a runtime ensure_known_schema is now a thing
the wire cannot express — and the published schema says so with a
const, so a foreign implementor validating against the wrong
record’s schema fails instead of passing.
Trait Implementations§
Source§impl ContentAddressable for Response
impl ContentAddressable for Response
Source§fn canonical_form(&self) -> Result<Vec<u8>, ContentError>
fn canonical_form(&self) -> Result<Vec<u8>, ContentError>
Source§fn content_id(&self) -> Result<ContentId, ContentError>
fn content_id(&self) -> Result<ContentId, ContentError>
Source§fn verify(&self, expected: &ContentId) -> Result<bool, ContentError>
fn verify(&self, expected: &ContentId) -> Result<bool, ContentError>
expected id. Read moreSource§fn ensure_content_id(&self, expected: &ContentId) -> Result<(), ContentError>
fn ensure_content_id(&self, expected: &ContentId) -> Result<(), ContentError>
Ok(false). Read moreSource§fn from_canonical_form(bytes: &[u8]) -> Result<Self, ContentError>where
Self: Sized + DeserializeOwned,
fn from_canonical_form(bytes: &[u8]) -> Result<Self, ContentError>where
Self: Sized + DeserializeOwned,
canonical_form. Read more