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>) -> Result<Self, LimitError>
pub fn for_program<J: Jet>(program: &RedeemNode<J>) -> Result<Self, LimitError>
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>(
&mut self,
program: &RedeemNode<J>,
env: &J::Environment,
) -> Result<Value, ExecutionError>
pub fn exec<J: Jet>( &mut self, program: &RedeemNode<J>, env: &J::Environment, ) -> Result<Value, ExecutionError>
Execute the given program
on the Bit Machine, using the given environment.
§Precondition
The Bit Machine is constructed via Self::for_program()
to ensure enough space.
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