pub enum Instr {
Show 21 variants
Send {
chan: Reg,
val: Reg,
},
Receive {
chan: Reg,
dst: Reg,
},
Offer {
chan: Reg,
label: String,
},
Choose {
chan: Reg,
table: Vec<(String, PC)>,
},
Open {
roles: Vec<String>,
local_types: Vec<(String, LocalTypeR)>,
handlers: Vec<((String, String), String)>,
dsts: Vec<(String, Reg)>,
},
Close {
session: Reg,
},
Invoke {
action: InvokeAction,
dst: Option<Reg>,
},
Acquire {
layer: String,
dst: Reg,
},
Release {
layer: String,
evidence: Reg,
},
Fork {
ghost: Reg,
},
Join,
Abort,
Transfer {
endpoint: Reg,
target: Reg,
bundle: Reg,
},
Tag {
fact: Reg,
dst: Reg,
},
Check {
knowledge: Reg,
target: Reg,
dst: Reg,
},
Set {
dst: Reg,
val: ImmValue,
},
Move {
dst: Reg,
src: Reg,
},
Jump {
target: PC,
},
Spawn {
target: PC,
args: Vec<Reg>,
},
Yield,
Halt,
}Expand description
Bytecode instruction.
The initial instruction set covers communication, session lifecycle, effects, and control flow. Guard/speculation/ownership instructions are deferred.
Variants§
Send
Send value in val register to channel in chan register.
Receive
Receive from channel in chan register, store in dst register.
Offer
Offer a label on channel.
Choose
Choose from a branch table using a received label.
Open
Open a new session with the given roles and endpoint destinations.
Fields
local_types: Vec<(String, LocalTypeR)>Role-to-local-type mappings for session initialization.
Close
Close the session referenced by the register.
Invoke
Invoke an effect handler action.
Fields
action: InvokeActionAction descriptor.
Acquire
Acquire a guard layer and store evidence in a register.
Release
Release a guard layer using evidence from a register.
Fork
Enter speculation using a ghost session id.
Join
Join speculative execution.
Abort
Abort speculative execution.
Transfer
Transfer an endpoint to another coroutine.
Fields
Tag
Tag a knowledge fact and return success.
Check
Check a knowledge fact against the flow policy.
Fields
Set
Set a register to an immediate value.
Move
Copy register src to dst.
Jump
Unconditional jump.
Spawn
Spawn a new coroutine at target PC with argument registers.
Fields
Yield
Yield execution to the scheduler.
Halt
Halt this coroutine (normal termination).
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Instr
impl<'de> Deserialize<'de> for Instr
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for Instr
impl StructuralPartialEq for Instr
Auto Trait Implementations§
impl Freeze for Instr
impl RefUnwindSafe for Instr
impl Send for Instr
impl Sync for Instr
impl Unpin for Instr
impl UnsafeUnpin for Instr
impl UnwindSafe for Instr
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
Source§impl<T> CheckedAs for T
impl<T> CheckedAs for T
Source§fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
Source§impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
Source§fn checked_cast_from(src: Src) -> Option<Dst>
fn checked_cast_from(src: Src) -> Option<Dst>
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.