Struct CairoInstruction

Source
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> Freeze for CairoInstruction<F>
where F: Freeze,

§

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 T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

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

Source§

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

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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 T
where 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

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 for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

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 T
where U: Into<T>,

Source§

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 T
where U: TryFrom<T>,

Source§

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 T
where V: MultiLane<T>,

§

fn vzip(self) -> V