pub struct Chunk {
pub name: String,
pub constants: Vec<Value>,
pub code: Vec<Instruction>,
pub functions: Vec<FunctionDef>,
}Expand description
A compiled unit of Byteflow bytecode: code, constants and the function
table. One Chunk can back many concurrently-running processes — it is
immutable after construction, so it is shared behind an Arc rather than
copied per Flow (see byteflow-vm::Vm::chunk).
Fields§
§name: String§constants: Vec<Value>§code: Vec<Instruction>§functions: Vec<FunctionDef>Implementations§
Source§impl Chunk
impl Chunk
pub fn function(&self, index: u32) -> Option<&FunctionDef>
pub fn constant(&self, index: u32) -> Option<&Value>
Sourcepub fn len(&self) -> usize
pub fn len(&self) -> usize
Number of instructions, used by the verifier to bound-check jump targets ahead of time instead of on every branch at runtime.
pub fn is_empty(&self) -> bool
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Chunk
impl RefUnwindSafe for Chunk
impl Send for Chunk
impl Sync for Chunk
impl Unpin for Chunk
impl UnsafeUnpin for Chunk
impl UnwindSafe for Chunk
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