pub struct BitMachine { /* private fields */ }Expand description
An execution context for a Simplicity program
Implementations§
Source§impl BitMachine
impl BitMachine
Sourcepub fn for_program<J: Jet>(program: &RedeemNode<J>) -> Self
pub fn for_program<J: Jet>(program: &RedeemNode<J>) -> Self
Construct a Bit Machine with enough space to execute the given program.
Sourcepub fn input(&mut self, input: &Value) -> Result<(), ExecutionError>
pub fn input(&mut self, input: &Value) -> Result<(), ExecutionError>
Add a read frame with some given value in it, as input to the program
Sourcepub fn exec<J: Jet + Debug>(
&mut self,
program: &RedeemNode<J>,
env: &J::Environment,
) -> Result<Value, ExecutionError>
pub fn exec<J: Jet + Debug>( &mut self, program: &RedeemNode<J>, env: &J::Environment, ) -> Result<Value, ExecutionError>
Execute the given program on the Bit Machine, using the given environment.
Make sure the Bit Machine has enough space by constructing it via Self::for_program().
Auto Trait Implementations§
impl Freeze for BitMachine
impl RefUnwindSafe for BitMachine
impl Send for BitMachine
impl Sync for BitMachine
impl Unpin for BitMachine
impl UnwindSafe for BitMachine
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