pub struct Program { /* private fields */ }Expand description
Assemble one bytecode module.
Implementations§
Source§impl Program
impl Program
Sourcepub fn new(name: impl Into<String>) -> Self
pub fn new(name: impl Into<String>) -> Self
Start a new module named name.
Examples found in repository?
More examples
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
Define a function and run body against a fresh Fn context.
Examples found in repository?
More examples
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 Freeze for Program
impl RefUnwindSafe for Program
impl Send for Program
impl Sync for Program
impl Unpin for Program
impl UnsafeUnpin for Program
impl UnwindSafe for Program
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