pub struct Program { /* private fields */ }Expand description
Assemble one bytecode module.
Implementations§
Source§impl Program
impl Program
Sourcepub fn function(
&mut self,
name: impl Into<String>,
arity: u8,
body: impl FnOnce(&mut Fn<'_>),
) -> FuncId
pub fn function( &mut self, name: impl Into<String>, arity: u8, body: impl FnOnce(&mut Fn<'_>), ) -> FuncId
Sourcepub fn function_raw(
&mut self,
name: impl Into<String>,
arity: u8,
num_registers: u8,
body: impl FnOnce(&mut Fn<'_>),
) -> FuncId
pub fn function_raw( &mut self, name: impl Into<String>, arity: u8, num_registers: u8, body: impl FnOnce(&mut Fn<'_>), ) -> FuncId
Define a function with an explicit register-file size.
Useful for fixed register layouts (reg(255)) or verification demos
where num_registers < arity must fail static checks.
Sourcepub fn function_index(&self, name: &str) -> Option<FuncId>
pub fn function_index(&self, name: &str) -> Option<FuncId>
Look up a function index by name (available before Self::build).
Auto Trait Implementations§
impl Forget for Program
impl Freeze for Programwhere
*const u8 is !null: Freeze,
PhantomData<u8>: Freeze,
PhantomData<Value>: Freeze,
PhantomData<Instruction>: Freeze,
PhantomData<FunctionDef>: Freeze,
PhantomData<(Label, u32)>: Freeze,
PhantomData<(usize, Label)>: Freeze,
PhantomData<(String, u32)>: Freeze,
impl Move for Program
impl RefUnwindSafe for Program
impl Send for Program
impl Sync for Program
impl Unpin for Program
impl UnsafeUnpin for Programwhere
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
PhantomData<Value>: UnsafeUnpin,
PhantomData<Instruction>: UnsafeUnpin,
PhantomData<FunctionDef>: UnsafeUnpin,
PhantomData<(Label, u32)>: UnsafeUnpin,
PhantomData<(usize, Label)>: UnsafeUnpin,
PhantomData<(String, u32)>: UnsafeUnpin,
impl UnwindSafe for Programwhere
RawVecInner: UnwindSafe,
Arc<Value>: UnwindSafe,
Arc<str>: UnwindSafe,
Arc<[u8]>: UnwindSafe,
Arc<[Value]>: UnwindSafe,
Arc<[(MapKey, Value)]>: UnwindSafe,
HashMap<Label, u32>: UnwindSafe,
HashMap<String, u32>: 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