Skip to main content

Instance

Struct Instance 

Source
pub struct Instance<'a> {
    pub dialect: &'a Dialect,
    pub thread: ThreadId,
    pub acts: &'a [Act],
    pub opener: Option<&'a Act>,
    pub root: Option<&'a Act>,
    pub cast: Option<Cast>,
}
Expand description

The instance context (SPEC-019 CON-1903): everything a state function may read. The cast is parsed from the accepted root wrapper, never supplied by a caller.

Fields§

§dialect: &'a Dialect§thread: ThreadId§acts: &'a [Act]§opener: Option<&'a Act>

The act of the opener verb.

§root: Option<&'a Act>

Under R6, the cast-bearing root (SPEC-014 REQ-611/623), which the opener follows; None for a role-free dialect.

§cast: Option<Cast>

Implementations§

Source§

impl<'a> Instance<'a>

Source

pub fn new( dialect: &'a Dialect, thread: ThreadId, acts: &'a [Act], ) -> Result<Instance<'a>, String>

Build the context from accepted acts. For a role-declaring dialect the cast is read from the with-roles root among the acts.

Source

pub fn store(&self) -> ThreadedMessageStore

The accepted acts as a store keyed by content address.

Source

pub fn instance_id(&self) -> Option<&str>

The address of the accepted opener.

Trait Implementations§

Source§

impl<'a> Clone for Instance<'a>

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<'a> Debug for Instance<'a>

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'a> Forget for Instance<'a>

§

impl<'a> Freeze for Instance<'a>
where &'a Dialect: Freeze, *const u8 is !null: Freeze, PhantomData<u8>: Freeze, &'a [Act]: Freeze, &'a Act: Freeze, *const LeafNode<String, AgentKey> is !null: Freeze, PhantomData<(Owned, LeafOrInternal)>: Freeze, PhantomData<Box<(String, AgentKey)>>: Freeze, *const LeafNode<String, BTreeSet<AgentKey>> is !null: Freeze, PhantomData<Box<(String, BTreeSet<AgentKey>)>>: Freeze,

§

impl<'a> Move for Instance<'a>

§

impl<'a> RefUnwindSafe for Instance<'a>

§

impl<'a> Send for Instance<'a>
where &'a Dialect: Send, RawVecInner: Send, &'a [Act]: Send, &'a Act: Send, NodeRef<Owned, String, AgentKey, LeafOrInternal>: Send, BoxRaw<(String, AgentKey)>: Send, NodeRef<Owned, String, BTreeSet<AgentKey>, LeafOrInternal>: Send, BoxRaw<(String, BTreeSet<AgentKey>)>: Send,

§

impl<'a> Sync for Instance<'a>
where NodeRef<Owned, String, SExpr, LeafOrInternal>: Sync, BoxRaw<(String, SExpr)>: Sync, RawVecInner: Sync, NodeRef<Owned, String, SetValZST, LeafOrInternal>: Sync, BoxRaw<(String, SetValZST)>: Sync, NodeRef<Owned, String, StepDecl, LeafOrInternal>: Sync, BoxRaw<(String, StepDecl)>: Sync, Arc<Node>: Sync, NodeRef<Owned, String, BTreeSet<String>, LeafOrInternal>: Sync, BoxRaw<(String, BTreeSet<String>)>: Sync, BoxRaw<Definition>: Sync, BoxRaw<Lift>: Sync, BoxRaw<CounterRule>: Sync, BoxRaw<Value>: Sync, BoxRaw<Message>: Sync, NodeRef<Owned, String, AgentKey, LeafOrInternal>: Sync, BoxRaw<(String, AgentKey)>: Sync, NodeRef<Owned, String, BTreeSet<AgentKey>, LeafOrInternal>: Sync, BoxRaw<(String, BTreeSet<AgentKey>)>: Sync,

§

impl<'a> Unpin for Instance<'a>
where &'a Dialect: Unpin, *const u8 is !null: Unpin, &'a [Act]: Unpin, &'a Act: Unpin, *const LeafNode<String, AgentKey> is !null: Unpin, Box<(String, AgentKey)>: Unpin, *const LeafNode<String, BTreeSet<AgentKey>> is !null: Unpin, Box<(String, BTreeSet<AgentKey>)>: Unpin,

§

impl<'a> UnsafeUnpin for Instance<'a>

§

impl<'a> UnwindSafe for Instance<'a>

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> 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> Same for T

Source§

type Output = T

Should always be Self
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.