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>
impl<'a> Instance<'a>
Sourcepub fn new(
dialect: &'a Dialect,
thread: ThreadId,
acts: &'a [Act],
) -> Result<Instance<'a>, String>
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.
Sourcepub fn store(&self) -> ThreadedMessageStore
pub fn store(&self) -> ThreadedMessageStore
The accepted acts as a store keyed by content address.
Sourcepub fn instance_id(&self) -> Option<&str>
pub fn instance_id(&self) -> Option<&str>
The address of the accepted opener.
Trait Implementations§
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>
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>
impl<'a> UnsafeUnpin for Instance<'a>where
&'a Dialect: UnsafeUnpin,
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
&'a [Act]: UnsafeUnpin,
&'a Act: UnsafeUnpin,
*const LeafNode<String, AgentKey> is !null: UnsafeUnpin,
PhantomData<(Owned, LeafOrInternal)>: UnsafeUnpin,
PhantomData<Box<(String, AgentKey)>>: UnsafeUnpin,
*const LeafNode<String, BTreeSet<AgentKey>> is !null: UnsafeUnpin,
PhantomData<Box<(String, BTreeSet<AgentKey>)>>: UnsafeUnpin,
impl<'a> UnwindSafe for Instance<'a>where
&'a Dialect: UnwindSafe,
RawVecInner: UnwindSafe,
&'a [Act]: UnwindSafe,
&'a Act: UnwindSafe,
BTreeMap<String, AgentKey>: UnwindSafe,
BTreeMap<String, BTreeSet<AgentKey>>: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more