pub enum AnInstruction<Dest: PartialEq + Default> {
Show 46 variants
Pop(NumberOfWords),
Push(BFieldElement),
Divine(NumberOfWords),
Pick(OpStackElement),
Place(OpStackElement),
Dup(OpStackElement),
Swap(OpStackElement),
Halt,
Nop,
Skiz,
Call(Dest),
Return,
Recurse,
RecurseOrReturn,
Assert,
ReadMem(NumberOfWords),
WriteMem(NumberOfWords),
Hash,
AssertVector,
SpongeInit,
SpongeAbsorb,
SpongeAbsorbMem,
SpongeSqueeze,
Add,
AddI(BFieldElement),
Mul,
Invert,
Eq,
Split,
Lt,
And,
Xor,
Log2Floor,
Pow,
DivMod,
PopCount,
XxAdd,
XxMul,
XInvert,
XbMul,
ReadIo(NumberOfWords),
WriteIo(NumberOfWords),
MerkleStep,
MerkleStepMem,
XxDotStep,
XbDotStep,
}
Expand description
A Triton VM instruction. See the Instruction Set Architecture for more details.
The type parameter Dest
describes the type of addresses (absolute or labels).
Variants§
Pop(NumberOfWords)
Push(BFieldElement)
Divine(NumberOfWords)
Pick(OpStackElement)
Place(OpStackElement)
Dup(OpStackElement)
Swap(OpStackElement)
Halt
Nop
Skiz
Call(Dest)
Return
Recurse
RecurseOrReturn
Assert
ReadMem(NumberOfWords)
WriteMem(NumberOfWords)
Hash
AssertVector
SpongeInit
SpongeAbsorb
SpongeAbsorbMem
SpongeSqueeze
Add
AddI(BFieldElement)
Mul
Invert
Eq
Split
Lt
And
Xor
Log2Floor
Pow
DivMod
PopCount
XxAdd
XxMul
XInvert
XbMul
ReadIo(NumberOfWords)
WriteIo(NumberOfWords)
MerkleStep
MerkleStepMem
XxDotStep
XbDotStep
Implementations§
Source§impl<Dest: PartialEq + Default> AnInstruction<Dest>
impl<Dest: PartialEq + Default> AnInstruction<Dest>
pub const fn name(&self) -> &'static str
pub const fn opcode_b(&self) -> BFieldElement
Sourcepub fn ib(&self, arg: InstructionBit) -> BFieldElement
pub fn ib(&self, arg: InstructionBit) -> BFieldElement
Get the i’th instruction bit
pub fn map_call_address<F, NewDest>(&self, f: F) -> AnInstruction<NewDest>
pub const fn op_stack_size_influence(&self) -> i32
Sourcepub fn is_u32_instruction(&self) -> bool
pub fn is_u32_instruction(&self) -> bool
Indicates whether the instruction operates on base field elements that are also u32s.
Source§impl AnInstruction<BFieldElement>
impl AnInstruction<BFieldElement>
Sourcepub fn arg(&self) -> Option<BFieldElement>
pub fn arg(&self) -> Option<BFieldElement>
Get the argument of the instruction, if it has one.
Sourcepub fn change_arg(
self,
new_arg: BFieldElement,
) -> Result<Self, InstructionError>
pub fn change_arg( self, new_arg: BFieldElement, ) -> Result<Self, InstructionError>
Change the argument of the instruction, if it has one. Returns an Err
if the instruction
does not have an argument or if the argument is out of range.
Trait Implementations§
Source§impl<'arbitrary, Dest: PartialEq + Default + Arbitrary<'arbitrary>> Arbitrary<'arbitrary> for AnInstruction<Dest>
impl<'arbitrary, Dest: PartialEq + Default + Arbitrary<'arbitrary>> Arbitrary<'arbitrary> for AnInstruction<Dest>
Source§fn arbitrary(u: &mut Unstructured<'arbitrary>) -> Result<Self>
fn arbitrary(u: &mut Unstructured<'arbitrary>) -> Result<Self>
Generate an arbitrary value of
Self
from the given unstructured data. Read moreSource§fn arbitrary_take_rest(u: Unstructured<'arbitrary>) -> Result<Self>
fn arbitrary_take_rest(u: Unstructured<'arbitrary>) -> Result<Self>
Generate an arbitrary value of
Self
from the entirety of the given
unstructured data. Read moreSource§fn size_hint(depth: usize) -> (usize, Option<usize>)
fn size_hint(depth: usize) -> (usize, Option<usize>)
Get a size hint for how many bytes out of an
Unstructured
this type
needs to construct itself. Read moreSource§fn try_size_hint(
depth: usize,
) -> Result<(usize, Option<usize>), MaxRecursionReached>
fn try_size_hint( depth: usize, ) -> Result<(usize, Option<usize>), MaxRecursionReached>
Get a size hint for how many bytes out of an
Unstructured
this type
needs to construct itself. Read moreSource§impl<Dest: Clone + PartialEq + Default> Clone for AnInstruction<Dest>
impl<Dest: Clone + PartialEq + Default> Clone for AnInstruction<Dest>
Source§fn clone(&self) -> AnInstruction<Dest>
fn clone(&self) -> AnInstruction<Dest>
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl<'de, Dest> Deserialize<'de> for AnInstruction<Dest>
impl<'de, Dest> Deserialize<'de> for AnInstruction<Dest>
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl<Dest: PartialEq + Default + GetSize> GetSize for AnInstruction<Dest>
impl<Dest: PartialEq + Default + GetSize> GetSize for AnInstruction<Dest>
Source§fn get_heap_size(&self) -> usize
fn get_heap_size(&self) -> usize
Determines how many bytes this object occupies inside the heap. Read more
Source§fn get_stack_size() -> usize
fn get_stack_size() -> usize
Determines how may bytes this object occupies inside the stack. Read more
Source§impl<Dest: PartialEq + Default> IntoEnumIterator for AnInstruction<Dest>
impl<Dest: PartialEq + Default> IntoEnumIterator for AnInstruction<Dest>
type Iterator = AnInstructionIter<Dest>
fn iter() -> AnInstructionIter<Dest> ⓘ
Source§impl<Dest> Serialize for AnInstruction<Dest>
impl<Dest> Serialize for AnInstruction<Dest>
impl<Dest: Copy + PartialEq + Default> Copy for AnInstruction<Dest>
impl<Dest: Eq + PartialEq + Default> Eq for AnInstruction<Dest>
impl<Dest: PartialEq + Default> StructuralPartialEq for AnInstruction<Dest>
Auto Trait Implementations§
impl<Dest> Freeze for AnInstruction<Dest>where
Dest: Freeze,
impl<Dest> RefUnwindSafe for AnInstruction<Dest>where
Dest: RefUnwindSafe,
impl<Dest> Send for AnInstruction<Dest>where
Dest: Send,
impl<Dest> Sync for AnInstruction<Dest>where
Dest: Sync,
impl<Dest> Unpin for AnInstruction<Dest>where
Dest: Unpin,
impl<Dest> UnwindSafe for AnInstruction<Dest>where
Dest: UnwindSafe,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more