Struct simplicity::bit_machine::BitMachine
source · 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)
pub fn input(&mut self, input: &Value)
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<Arc<Value>, ExecutionError>
pub fn exec<J: Jet + Debug>( &mut self, program: &RedeemNode<J>, env: &J::Environment ) -> Result<Arc<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 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