pub struct CairoInstruction<F> { /* private fields */ }
Expand description

This structure stores all the needed information relative to an instruction at a given step of computation

Implementations§

source§

impl<F: Field> CairoInstruction<F>

source

pub fn new( word: CairoWord<F>, ptrs: CairoState<F>, vars: CairoContext<F> ) -> Self

Creates a CairoInstruction

source

pub fn instr(&self) -> F

Returns the field element corresponding to the CairoInstruction

source

pub fn size(&self) -> F

Returns the size of the instruction

source

pub fn res(&self) -> F

Returns the result of the instruction

source

pub fn dst(&self) -> F

Returns the destination of the instruction

source

pub fn op0(&self) -> F

Returns the first operand of the instruction

source

pub fn op1(&self) -> F

Returns the second operand of the instruction

source

pub fn adr_dst(&self) -> F

Returns the destination address of the instruction

source

pub fn adr_op0(&self) -> F

Returns the first operand address of the instruction

source

pub fn adr_op1(&self) -> F

Returns the second operand address of the instruction

Trait Implementations§

source§

impl<F: Clone> Clone for CairoInstruction<F>

source§

fn clone(&self) -> CairoInstruction<F>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<F: Field> FlagBits<F> for CairoInstruction<F>

source§

fn f_dst_fp(&self) -> F

Returns bit-flag for destination register as F
source§

fn f_op0_fp(&self) -> F

Returns bit-flag for first operand register as F
source§

fn f_op1_val(&self) -> F

Returns bit-flag for immediate value for second register as F
source§

fn f_op1_fp(&self) -> F

Returns bit-flag for frame pointer for second register as F
source§

fn f_op1_ap(&self) -> F

Returns bit-flag for allocation pointer for second regsiter as F
source§

fn f_res_add(&self) -> F

Returns bit-flag for addition operation in right side as F
source§

fn f_res_mul(&self) -> F

Returns bit-flag for multiplication operation in right side as F
source§

fn f_pc_abs(&self) -> F

Returns bit-flag for program counter update being absolute jump as F
source§

fn f_pc_rel(&self) -> F

Returns bit-flag for program counter update being relative jump as F
source§

fn f_pc_jnz(&self) -> F

Returns bit-flag for program counter update being conditional jump as F
source§

fn f_ap_add(&self) -> F

Returns bit-flag for allocation counter update being a manual addition as F
source§

fn f_ap_one(&self) -> F

Returns bit-flag for allocation counter update being a self increment as F
source§

fn f_opc_call(&self) -> F

Returns bit-flag for operation being a call as F
source§

fn f_opc_ret(&self) -> F

Returns bit-flag for operation being a return as F
source§

fn f_opc_aeq(&self) -> F

Returns bit-flag for operation being an assert-equal as F
source§

fn f15(&self) -> F

Returns bit-flag for 16th position
source§

impl<F: Field> Offsets<F> for CairoInstruction<F>

source§

fn off_dst(&self) -> F

Returns the destination offset in biased representation
source§

fn off_op0(&self) -> F

Returns the first operand offset in biased representation
source§

fn off_op1(&self) -> F

Returns the second operand offset in biased representation
source§

impl<F: Field> Pointers<F> for CairoInstruction<F>

source§

fn pc(&self) -> F

Returns the program counter
source§

fn ap(&self) -> F

Returns the allocation pointer
source§

fn fp(&self) -> F

Returns the frame pointer
source§

impl<F: Copy> Copy for CairoInstruction<F>

Auto Trait Implementations§

§

impl<F> RefUnwindSafe for CairoInstruction<F>where F: RefUnwindSafe,

§

impl<F> Send for CairoInstruction<F>where F: Send,

§

impl<F> Sync for CairoInstruction<F>where F: Sync,

§

impl<F> Unpin for CairoInstruction<F>where F: Unpin,

§

impl<F> UnwindSafe for CairoInstruction<F>where F: UnwindSafe,

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<T> Pointable for T

§

const ALIGN: usize = mem::align_of::<T>()

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same<T> for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere V: MultiLane<T>,

§

fn vzip(self) -> V