pub struct InteractionInstance {
pub schema: InstanceTag,
pub nonce: Nonce,
pub definition: DefinitionId,
pub revision: Revision,
pub ttl_ticks: i64,
pub scope: Scope,
pub responder_policy: ResponderPolicy,
pub provenance: Provenance,
}Expand description
A live offer of one definition to one audience.
Binds the routing nonce to the definition’s content id, the revision, the
TTL, the scope, the frozen responder policy, and the provenance — and the
whole binding is itself content-addressed, so an offer cannot be altered
without changing its InstanceId.
Fields§
§schema: InstanceTagVersioned type tag; see INSTANCE_SCHEMA_V1.
nonce: NonceFresh, unguessable routing handle. Not the identity.
definition: DefinitionIdThe definition being offered — its exact form digest.
revision: RevisionThe revision offered.
ttl_ticks: i64Ticks after provenance.minted_tick at which this offer expires.
scope: ScopeThe workspace fence.
responder_policy: ResponderPolicyFrozen eligibility.
provenance: ProvenanceWhere this offer came from.
Implementations§
Source§impl InteractionInstance
impl InteractionInstance
Sourcepub fn instance_id(&self) -> Result<InstanceId, ProtocolError>
pub fn instance_id(&self) -> Result<InstanceId, 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 Clone for InteractionInstance
impl Clone for InteractionInstance
Source§impl ContentAddressable for InteractionInstance
impl ContentAddressable for InteractionInstance
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