Skip to main content

InteractionInstance

Struct InteractionInstance 

Source
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: InstanceTag

Versioned type tag; see INSTANCE_SCHEMA_V1.

§nonce: Nonce

Fresh, unguessable routing handle. Not the identity.

§definition: DefinitionId

The definition being offered — its exact form digest.

§revision: Revision

The revision offered.

§ttl_ticks: i64

Ticks after provenance.minted_tick at which this offer expires.

§scope: Scope

The workspace fence.

§responder_policy: ResponderPolicy

Frozen eligibility.

§provenance: Provenance

Where this offer came from.

Implementations§

Source§

impl InteractionInstance

Source

pub fn instance_id(&self) -> Result<InstanceId, ProtocolError>

This instance’s identity.

§Errors

Propagates a canonical-encoding failure.

Source

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

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl ContentAddressable for InteractionInstance

Source§

fn canonical_form(&self) -> Result<Vec<u8>, ContentError>

Produce the deterministic byte representation of this value. Read more
Source§

fn content_id(&self) -> Result<ContentId, ContentError>

Compute this value’s ContentId. Read more
Source§

fn verify(&self, expected: &ContentId) -> Result<bool, ContentError>

Check whether this value’s content id matches an expected id. Read more
Source§

fn ensure_content_id(&self, expected: &ContentId) -> Result<(), ContentError>

Verify, returning an error on mismatch instead of Ok(false). Read more
Source§

fn from_canonical_form(bytes: &[u8]) -> Result<Self, ContentError>
where Self: Sized + DeserializeOwned,

Checked ingress: decode a value from its canonical form, proving the bytes reproduce it — a checked partial inverse of canonical_form. Read more
Source§

impl Debug for InteractionInstance

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for InteractionInstance

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Eq for InteractionInstance

Source§

impl PartialEq for InteractionInstance

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl Serialize for InteractionInstance

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for InteractionInstance

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.