pub struct CairoStep<'a, F> {
pub mem: &'a mut CairoMemory<F>,
pub curr: CairoState<F>,
pub next: Option<CairoState<F>>,
pub vars: CairoContext<F>,
}
Expand description
A data structure to store a current step of Cairo computation
Fields§
§mem: &'a mut CairoMemory<F>
state of the computation
curr: CairoState<F>
current pointers
next: Option<CairoState<F>>
(if any) next pointers
vars: CairoContext<F>
state auxiliary variables
Implementations§
Source§impl<'a, F: Field> CairoStep<'a, F>
impl<'a, F: Field> CairoStep<'a, F>
Sourcepub fn new(mem: &mut CairoMemory<F>, ptrs: CairoState<F>) -> CairoStep<'_, F>
pub fn new(mem: &mut CairoMemory<F>, ptrs: CairoState<F>) -> CairoStep<'_, F>
Creates a new Cairo execution step from a step index, a Cairo word, and current pointers
Sourcepub fn execute(&mut self) -> CairoInstruction<F>
pub fn execute(&mut self) -> CairoInstruction<F>
Executes a Cairo step from the current registers
Sourcepub fn instr(&mut self) -> CairoWord<F>
pub fn instr(&mut self) -> CairoWord<F>
This function returns the current word instruction being executed
Sourcepub fn set_op1(&mut self)
pub fn set_op1(&mut self)
This function computes the second operand address and content and the instruction size
Panics if the flagset OP1_SRC
has more than 1 nonzero bit
Auto Trait Implementations§
impl<'a, F> Freeze for CairoStep<'a, F>where
F: Freeze,
impl<'a, F> RefUnwindSafe for CairoStep<'a, F>where
F: RefUnwindSafe,
impl<'a, F> Send for CairoStep<'a, F>where
F: Send,
impl<'a, F> Sync for CairoStep<'a, F>where
F: Sync,
impl<'a, F> Unpin for CairoStep<'a, F>where
F: Unpin,
impl<'a, F> !UnwindSafe for CairoStep<'a, F>
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