snarkvm_synthesizer_program::logic::instruction

Enum Instruction

Source
pub enum Instruction<N: Network> {
Show 68 variants Abs(Abs<N>), AbsWrapped(AbsWrapped<N>), Add(Add<N>), AddWrapped(AddWrapped<N>), And(And<N>), AssertEq(AssertEq<N>), AssertNeq(AssertNeq<N>), Async(Async<N>), Call(Call<N>), Cast(Cast<N>), CastLossy(CastLossy<N>), CommitBHP256(CommitBHP256<N>), CommitBHP512(CommitBHP512<N>), CommitBHP768(CommitBHP768<N>), CommitBHP1024(CommitBHP1024<N>), CommitPED64(CommitPED64<N>), CommitPED128(CommitPED128<N>), Div(Div<N>), DivWrapped(DivWrapped<N>), Double(Double<N>), GreaterThan(GreaterThan<N>), GreaterThanOrEqual(GreaterThanOrEqual<N>), HashBHP256(HashBHP256<N>), HashBHP512(HashBHP512<N>), HashBHP768(HashBHP768<N>), HashBHP1024(HashBHP1024<N>), HashKeccak256(HashKeccak256<N>), HashKeccak384(HashKeccak384<N>), HashKeccak512(HashKeccak512<N>), HashPED64(HashPED64<N>), HashPED128(HashPED128<N>), HashPSD2(HashPSD2<N>), HashPSD4(HashPSD4<N>), HashPSD8(HashPSD8<N>), HashSha3_256(HashSha3_256<N>), HashSha3_384(HashSha3_384<N>), HashSha3_512(HashSha3_512<N>), HashManyPSD2(HashManyPSD2<N>), HashManyPSD4(HashManyPSD4<N>), HashManyPSD8(HashManyPSD8<N>), Inv(Inv<N>), IsEq(IsEq<N>), IsNeq(IsNeq<N>), LessThan(LessThan<N>), LessThanOrEqual(LessThanOrEqual<N>), Modulo(Modulo<N>), Mul(Mul<N>), MulWrapped(MulWrapped<N>), Nand(Nand<N>), Neg(Neg<N>), Nor(Nor<N>), Not(Not<N>), Or(Or<N>), Pow(Pow<N>), PowWrapped(PowWrapped<N>), Rem(Rem<N>), RemWrapped(RemWrapped<N>), Shl(Shl<N>), ShlWrapped(ShlWrapped<N>), Shr(Shr<N>), ShrWrapped(ShrWrapped<N>), SignVerify(SignVerify<N>), Square(Square<N>), SquareRoot(SquareRoot<N>), Sub(Sub<N>), SubWrapped(SubWrapped<N>), Ternary(Ternary<N>), Xor(Xor<N>),
}

Variants§

§

Abs(Abs<N>)

Compute the absolute value of first, checking for overflow, and storing the outcome in destination.

§

AbsWrapped(AbsWrapped<N>)

Compute the absolute value of first, wrapping around at the boundary of the type, and storing the outcome in destination.

§

Add(Add<N>)

Adds first with second, storing the outcome in destination.

§

AddWrapped(AddWrapped<N>)

Adds first with second, wrapping around at the boundary of the type, and storing the outcome in destination.

§

And(And<N>)

Performs a bitwise and operation on first and second, storing the outcome in destination.

§

AssertEq(AssertEq<N>)

Asserts first and second are equal.

§

AssertNeq(AssertNeq<N>)

Asserts first and second are not equal.

§

Async(Async<N>)

Calls a finalize asynchronously on the operands.

§

Call(Call<N>)

Calls a closure or function on the operands.

§

Cast(Cast<N>)

Casts the operands into the declared type.

§

CastLossy(CastLossy<N>)

Casts the operands into the declared type, with lossy truncation if applicable.

§

CommitBHP256(CommitBHP256<N>)

Performs a BHP commitment on inputs of 256-bit chunks.

§

CommitBHP512(CommitBHP512<N>)

Performs a BHP commitment on inputs of 512-bit chunks.

§

CommitBHP768(CommitBHP768<N>)

Performs a BHP commitment on inputs of 768-bit chunks.

§

CommitBHP1024(CommitBHP1024<N>)

Performs a BHP commitment on inputs of 1024-bit chunks.

§

CommitPED64(CommitPED64<N>)

Performs a Pedersen commitment on up to a 64-bit input.

§

CommitPED128(CommitPED128<N>)

Performs a Pedersen commitment on up to a 128-bit input.

§

Div(Div<N>)

Divides first by second, storing the outcome in destination.

§

DivWrapped(DivWrapped<N>)

Divides first by second, wrapping around at the boundary of the type, and storing the outcome in destination.

§

Double(Double<N>)

Doubles first, storing the outcome in destination.

§

GreaterThan(GreaterThan<N>)

Computes whether first is greater than second as a boolean, storing the outcome in destination.

§

GreaterThanOrEqual(GreaterThanOrEqual<N>)

Computes whether first is greater than or equal to second as a boolean, storing the outcome in destination.

§

HashBHP256(HashBHP256<N>)

Performs a BHP hash on inputs of 256-bit chunks.

§

HashBHP512(HashBHP512<N>)

Performs a BHP hash on inputs of 512-bit chunks.

§

HashBHP768(HashBHP768<N>)

Performs a BHP hash on inputs of 768-bit chunks.

§

HashBHP1024(HashBHP1024<N>)

Performs a BHP hash on inputs of 1024-bit chunks.

§

HashKeccak256(HashKeccak256<N>)

Performs a Keccak hash, outputting 256 bits.

§

HashKeccak384(HashKeccak384<N>)

Performs a Keccak hash, outputting 384 bits.

§

HashKeccak512(HashKeccak512<N>)

Performs a Keccak hash, outputting 512 bits.

§

HashPED64(HashPED64<N>)

Performs a Pedersen hash on up to a 64-bit input.

§

HashPED128(HashPED128<N>)

Performs a Pedersen hash on up to a 128-bit input.

§

HashPSD2(HashPSD2<N>)

Performs a Poseidon hash with an input rate of 2.

§

HashPSD4(HashPSD4<N>)

Performs a Poseidon hash with an input rate of 4.

§

HashPSD8(HashPSD8<N>)

Performs a Poseidon hash with an input rate of 8.

§

HashSha3_256(HashSha3_256<N>)

Performs a SHA-3 hash, outputting 256 bits.

§

HashSha3_384(HashSha3_384<N>)

Performs a SHA-3 hash, outputting 384 bits.

§

HashSha3_512(HashSha3_512<N>)

Performs a SHA-3 hash, outputting 512 bits.

§

HashManyPSD2(HashManyPSD2<N>)

Performs a Poseidon hash with an input rate of 2.

§

HashManyPSD4(HashManyPSD4<N>)

Performs a Poseidon hash with an input rate of 4.

§

HashManyPSD8(HashManyPSD8<N>)

Performs a Poseidon hash with an input rate of 8.

§

Inv(Inv<N>)

Computes the multiplicative inverse of first, storing the outcome in destination.

§

IsEq(IsEq<N>)

Computes whether first equals second as a boolean, storing the outcome in destination.

§

IsNeq(IsNeq<N>)

Computes whether first does not equals second as a boolean, storing the outcome in destination.

§

LessThan(LessThan<N>)

Computes whether first is less than second as a boolean, storing the outcome in destination.

§

LessThanOrEqual(LessThanOrEqual<N>)

Computes whether first is less than or equal to second as a boolean, storing the outcome in destination.

§

Modulo(Modulo<N>)

Computes first mod second, storing the outcome in destination.

§

Mul(Mul<N>)

Multiplies first with second, storing the outcome in destination.

§

MulWrapped(MulWrapped<N>)

Multiplies first with second, wrapping around at the boundary of the type, and storing the outcome in destination.

§

Nand(Nand<N>)

Returns false if first and second are true, storing the outcome in destination.

§

Neg(Neg<N>)

Negates first, storing the outcome in destination.

§

Nor(Nor<N>)

Returns true if neither first nor second is true, storing the outcome in destination.

§

Not(Not<N>)

Flips each bit in the representation of first, storing the outcome in destination.

§

Or(Or<N>)

Performs a bitwise or on first and second, storing the outcome in destination.

§

Pow(Pow<N>)

Raises first to the power of second, storing the outcome in destination.

§

PowWrapped(PowWrapped<N>)

Raises first to the power of second, wrapping around at the boundary of the type, storing the outcome in destination.

§

Rem(Rem<N>)

Divides first by second, storing the remainder in destination.

§

RemWrapped(RemWrapped<N>)

Divides first by second, wrapping around at the boundary of the type, storing the remainder in destination.

§

Shl(Shl<N>)

Shifts first left by second bits, storing the outcome in destination.

§

ShlWrapped(ShlWrapped<N>)

Shifts first left by second bits, wrapping around at the boundary of the type, storing the outcome in destination.

§

Shr(Shr<N>)

Shifts first right by second bits, storing the outcome in destination.

§

ShrWrapped(ShrWrapped<N>)

Shifts first right by second bits, wrapping around at the boundary of the type, storing the outcome in destination.

§

SignVerify(SignVerify<N>)

Computes whether signature is valid for the given address and message.

§

Square(Square<N>)

Squares ‘first’, storing the outcome in destination.

§

SquareRoot(SquareRoot<N>)

Compute the square root of ‘first’, storing the outcome in destination.

§

Sub(Sub<N>)

Computes first - second, storing the outcome in destination.

§

SubWrapped(SubWrapped<N>)

Computes first - second, wrapping around at the boundary of the type, and storing the outcome in destination.

§

Ternary(Ternary<N>)

Selects first, if condition is true, otherwise selects second, storing the result in destination.

§

Xor(Xor<N>)

Performs a bitwise xor on first and second, storing the outcome in destination.

Implementations§

Source§

impl<N: Network> Instruction<N>

Source

pub const OPCODES: &'static [Opcode] = _

The list of all instruction opcodes.

Source

pub const fn opcode(&self) -> Opcode

Returns the opcode of the instruction.

Source

pub fn operands(&self) -> &[Operand<N>]

Returns the operands of the instruction.

Source

pub fn evaluate( &self, stack: &(impl StackMatches<N> + StackProgram<N>), registers: &mut (impl RegistersSigner<N> + RegistersLoad<N> + RegistersStore<N>), ) -> Result<()>

Evaluates the instruction.

Source

pub fn execute<A: Aleo<Network = N>>( &self, stack: &(impl StackMatches<N> + StackProgram<N>), registers: &mut (impl RegistersSignerCircuit<N, A> + RegistersLoadCircuit<N, A> + RegistersStoreCircuit<N, A>), ) -> Result<()>

Executes the instruction.

Source

pub fn finalize( &self, stack: &(impl StackMatches<N> + StackProgram<N>), registers: &mut (impl RegistersLoad<N> + RegistersStore<N>), ) -> Result<()>

Finalizes the instruction.

Source

pub fn output_types( &self, stack: &impl StackProgram<N>, input_types: &[RegisterType<N>], ) -> Result<Vec<RegisterType<N>>>

Returns the output type from the given input types.

Trait Implementations§

Source§

impl<N: Clone + Network> Clone for Instruction<N>

Source§

fn clone(&self) -> Instruction<N>

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<N: Network> Debug for Instruction<N>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Prints the instruction as a string.

Source§

impl<N: Network> Display for Instruction<N>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Prints the instruction as a string.

Source§

impl<N: Network> From<AssertInstruction<N, { Variant::AssertEq as u8 }>> for Instruction<N>

Source§

fn from(operation: AssertEq<N>) -> Self

Converts to this type from the input type.
Source§

impl<N: Network> From<AssertInstruction<N, { Variant::AssertNeq as u8 }>> for Instruction<N>

Source§

fn from(operation: AssertNeq<N>) -> Self

Converts to this type from the input type.
Source§

impl<N: Network> From<Async<N>> for Instruction<N>

Source§

fn from(operation: Async<N>) -> Self

Converts to this type from the input type.
Source§

impl<N: Network> From<Call<N>> for Instruction<N>

Source§

fn from(operation: Call<N>) -> Self

Converts to this type from the input type.
Source§

impl<N: Network> From<CastOperation<N, { CastVariant::Cast as u8 }>> for Instruction<N>

Source§

fn from(operation: Cast<N>) -> Self

Converts to this type from the input type.
Source§

impl<N: Network> From<CastOperation<N, { CastVariant::CastLossy as u8 }>> for Instruction<N>

Source§

fn from(operation: CastLossy<N>) -> Self

Converts to this type from the input type.
Source§

impl<N: Network> From<CommitInstruction<N, { Committer::CommitBHP1024 as u8 }>> for Instruction<N>

Source§

fn from(operation: CommitBHP1024<N>) -> Self

Converts to this type from the input type.
Source§

impl<N: Network> From<CommitInstruction<N, { Committer::CommitBHP256 as u8 }>> for Instruction<N>

Source§

fn from(operation: CommitBHP256<N>) -> Self

Converts to this type from the input type.
Source§

impl<N: Network> From<CommitInstruction<N, { Committer::CommitBHP512 as u8 }>> for Instruction<N>

Source§

fn from(operation: CommitBHP512<N>) -> Self

Converts to this type from the input type.
Source§

impl<N: Network> From<CommitInstruction<N, { Committer::CommitBHP768 as u8 }>> for Instruction<N>

Source§

fn from(operation: CommitBHP768<N>) -> Self

Converts to this type from the input type.
Source§

impl<N: Network> From<CommitInstruction<N, { Committer::CommitPED128 as u8 }>> for Instruction<N>

Source§

fn from(operation: CommitPED128<N>) -> Self

Converts to this type from the input type.
Source§

impl<N: Network> From<CommitInstruction<N, { Committer::CommitPED64 as u8 }>> for Instruction<N>

Source§

fn from(operation: CommitPED64<N>) -> Self

Converts to this type from the input type.
Source§

impl<N: Network> From<HashInstruction<N, { Hasher::HashBHP1024 as u8 }>> for Instruction<N>

Source§

fn from(operation: HashBHP1024<N>) -> Self

Converts to this type from the input type.
Source§

impl<N: Network> From<HashInstruction<N, { Hasher::HashBHP256 as u8 }>> for Instruction<N>

Source§

fn from(operation: HashBHP256<N>) -> Self

Converts to this type from the input type.
Source§

impl<N: Network> From<HashInstruction<N, { Hasher::HashBHP512 as u8 }>> for Instruction<N>

Source§

fn from(operation: HashBHP512<N>) -> Self

Converts to this type from the input type.
Source§

impl<N: Network> From<HashInstruction<N, { Hasher::HashBHP768 as u8 }>> for Instruction<N>

Source§

fn from(operation: HashBHP768<N>) -> Self

Converts to this type from the input type.
Source§

impl<N: Network> From<HashInstruction<N, { Hasher::HashKeccak256 as u8 }>> for Instruction<N>

Source§

fn from(operation: HashKeccak256<N>) -> Self

Converts to this type from the input type.
Source§

impl<N: Network> From<HashInstruction<N, { Hasher::HashKeccak384 as u8 }>> for Instruction<N>

Source§

fn from(operation: HashKeccak384<N>) -> Self

Converts to this type from the input type.
Source§

impl<N: Network> From<HashInstruction<N, { Hasher::HashKeccak512 as u8 }>> for Instruction<N>

Source§

fn from(operation: HashKeccak512<N>) -> Self

Converts to this type from the input type.
Source§

impl<N: Network> From<HashInstruction<N, { Hasher::HashManyPSD2 as u8 }>> for Instruction<N>

Source§

fn from(operation: HashManyPSD2<N>) -> Self

Converts to this type from the input type.
Source§

impl<N: Network> From<HashInstruction<N, { Hasher::HashManyPSD4 as u8 }>> for Instruction<N>

Source§

fn from(operation: HashManyPSD4<N>) -> Self

Converts to this type from the input type.
Source§

impl<N: Network> From<HashInstruction<N, { Hasher::HashManyPSD8 as u8 }>> for Instruction<N>

Source§

fn from(operation: HashManyPSD8<N>) -> Self

Converts to this type from the input type.
Source§

impl<N: Network> From<HashInstruction<N, { Hasher::HashPED128 as u8 }>> for Instruction<N>

Source§

fn from(operation: HashPED128<N>) -> Self

Converts to this type from the input type.
Source§

impl<N: Network> From<HashInstruction<N, { Hasher::HashPED64 as u8 }>> for Instruction<N>

Source§

fn from(operation: HashPED64<N>) -> Self

Converts to this type from the input type.
Source§

impl<N: Network> From<HashInstruction<N, { Hasher::HashPSD2 as u8 }>> for Instruction<N>

Source§

fn from(operation: HashPSD2<N>) -> Self

Converts to this type from the input type.
Source§

impl<N: Network> From<HashInstruction<N, { Hasher::HashPSD4 as u8 }>> for Instruction<N>

Source§

fn from(operation: HashPSD4<N>) -> Self

Converts to this type from the input type.
Source§

impl<N: Network> From<HashInstruction<N, { Hasher::HashPSD8 as u8 }>> for Instruction<N>

Source§

fn from(operation: HashPSD8<N>) -> Self

Converts to this type from the input type.
Source§

impl<N: Network> From<HashInstruction<N, { Hasher::HashSha3_256 as u8 }>> for Instruction<N>

Source§

fn from(operation: HashSha3_256<N>) -> Self

Converts to this type from the input type.
Source§

impl<N: Network> From<HashInstruction<N, { Hasher::HashSha3_384 as u8 }>> for Instruction<N>

Source§

fn from(operation: HashSha3_384<N>) -> Self

Converts to this type from the input type.
Source§

impl<N: Network> From<HashInstruction<N, { Hasher::HashSha3_512 as u8 }>> for Instruction<N>

Source§

fn from(operation: HashSha3_512<N>) -> Self

Converts to this type from the input type.
Source§

impl<N: Network> From<IsInstruction<N, { Variant::IsEq as u8 }>> for Instruction<N>

Source§

fn from(operation: IsEq<N>) -> Self

Converts to this type from the input type.
Source§

impl<N: Network> From<IsInstruction<N, { Variant::IsNeq as u8 }>> for Instruction<N>

Source§

fn from(operation: IsNeq<N>) -> Self

Converts to this type from the input type.
Source§

impl<N: Network> From<Literals<N, AbsOperation<N>, 1>> for Instruction<N>

Source§

fn from(operation: Abs<N>) -> Self

Converts to this type from the input type.
Source§

impl<N: Network> From<Literals<N, AbsWrappedOperation<N>, 1>> for Instruction<N>

Source§

fn from(operation: AbsWrapped<N>) -> Self

Converts to this type from the input type.
Source§

impl<N: Network> From<Literals<N, AddOperation<N>, 2>> for Instruction<N>

Source§

fn from(operation: Add<N>) -> Self

Converts to this type from the input type.
Source§

impl<N: Network> From<Literals<N, AddWrappedOperation<N>, 2>> for Instruction<N>

Source§

fn from(operation: AddWrapped<N>) -> Self

Converts to this type from the input type.
Source§

impl<N: Network> From<Literals<N, AndOperation<N>, 2>> for Instruction<N>

Source§

fn from(operation: And<N>) -> Self

Converts to this type from the input type.
Source§

impl<N: Network> From<Literals<N, DivOperation<N>, 2>> for Instruction<N>

Source§

fn from(operation: Div<N>) -> Self

Converts to this type from the input type.
Source§

impl<N: Network> From<Literals<N, DivWrappedOperation<N>, 2>> for Instruction<N>

Source§

fn from(operation: DivWrapped<N>) -> Self

Converts to this type from the input type.
Source§

impl<N: Network> From<Literals<N, DoubleOperation<N>, 1>> for Instruction<N>

Source§

fn from(operation: Double<N>) -> Self

Converts to this type from the input type.
Source§

impl<N: Network> From<Literals<N, GreaterThanOperation<N>, 2>> for Instruction<N>

Source§

fn from(operation: GreaterThan<N>) -> Self

Converts to this type from the input type.
Source§

impl<N: Network> From<Literals<N, GreaterThanOrEqualOperation<N>, 2>> for Instruction<N>

Source§

fn from(operation: GreaterThanOrEqual<N>) -> Self

Converts to this type from the input type.
Source§

impl<N: Network> From<Literals<N, InvOperation<N>, 1>> for Instruction<N>

Source§

fn from(operation: Inv<N>) -> Self

Converts to this type from the input type.
Source§

impl<N: Network> From<Literals<N, LessThanOperation<N>, 2>> for Instruction<N>

Source§

fn from(operation: LessThan<N>) -> Self

Converts to this type from the input type.
Source§

impl<N: Network> From<Literals<N, LessThanOrEqualOperation<N>, 2>> for Instruction<N>

Source§

fn from(operation: LessThanOrEqual<N>) -> Self

Converts to this type from the input type.
Source§

impl<N: Network> From<Literals<N, ModuloOperation<N>, 2>> for Instruction<N>

Source§

fn from(operation: Modulo<N>) -> Self

Converts to this type from the input type.
Source§

impl<N: Network> From<Literals<N, MulOperation<N>, 2>> for Instruction<N>

Source§

fn from(operation: Mul<N>) -> Self

Converts to this type from the input type.
Source§

impl<N: Network> From<Literals<N, MulWrappedOperation<N>, 2>> for Instruction<N>

Source§

fn from(operation: MulWrapped<N>) -> Self

Converts to this type from the input type.
Source§

impl<N: Network> From<Literals<N, NandOperation<N>, 2>> for Instruction<N>

Source§

fn from(operation: Nand<N>) -> Self

Converts to this type from the input type.
Source§

impl<N: Network> From<Literals<N, NegOperation<N>, 1>> for Instruction<N>

Source§

fn from(operation: Neg<N>) -> Self

Converts to this type from the input type.
Source§

impl<N: Network> From<Literals<N, NorOperation<N>, 2>> for Instruction<N>

Source§

fn from(operation: Nor<N>) -> Self

Converts to this type from the input type.
Source§

impl<N: Network> From<Literals<N, NotOperation<N>, 1>> for Instruction<N>

Source§

fn from(operation: Not<N>) -> Self

Converts to this type from the input type.
Source§

impl<N: Network> From<Literals<N, OrOperation<N>, 2>> for Instruction<N>

Source§

fn from(operation: Or<N>) -> Self

Converts to this type from the input type.
Source§

impl<N: Network> From<Literals<N, PowOperation<N>, 2>> for Instruction<N>

Source§

fn from(operation: Pow<N>) -> Self

Converts to this type from the input type.
Source§

impl<N: Network> From<Literals<N, PowWrappedOperation<N>, 2>> for Instruction<N>

Source§

fn from(operation: PowWrapped<N>) -> Self

Converts to this type from the input type.
Source§

impl<N: Network> From<Literals<N, RemOperation<N>, 2>> for Instruction<N>

Source§

fn from(operation: Rem<N>) -> Self

Converts to this type from the input type.
Source§

impl<N: Network> From<Literals<N, RemWrappedOperation<N>, 2>> for Instruction<N>

Source§

fn from(operation: RemWrapped<N>) -> Self

Converts to this type from the input type.
Source§

impl<N: Network> From<Literals<N, ShlOperation<N>, 2>> for Instruction<N>

Source§

fn from(operation: Shl<N>) -> Self

Converts to this type from the input type.
Source§

impl<N: Network> From<Literals<N, ShlWrappedOperation<N>, 2>> for Instruction<N>

Source§

fn from(operation: ShlWrapped<N>) -> Self

Converts to this type from the input type.
Source§

impl<N: Network> From<Literals<N, ShrOperation<N>, 2>> for Instruction<N>

Source§

fn from(operation: Shr<N>) -> Self

Converts to this type from the input type.
Source§

impl<N: Network> From<Literals<N, ShrWrappedOperation<N>, 2>> for Instruction<N>

Source§

fn from(operation: ShrWrapped<N>) -> Self

Converts to this type from the input type.
Source§

impl<N: Network> From<Literals<N, SquareOperation<N>, 1>> for Instruction<N>

Source§

fn from(operation: Square<N>) -> Self

Converts to this type from the input type.
Source§

impl<N: Network> From<Literals<N, SquareRootOperation<N>, 1>> for Instruction<N>

Source§

fn from(operation: SquareRoot<N>) -> Self

Converts to this type from the input type.
Source§

impl<N: Network> From<Literals<N, SubOperation<N>, 2>> for Instruction<N>

Source§

fn from(operation: Sub<N>) -> Self

Converts to this type from the input type.
Source§

impl<N: Network> From<Literals<N, SubWrappedOperation<N>, 2>> for Instruction<N>

Source§

fn from(operation: SubWrapped<N>) -> Self

Converts to this type from the input type.
Source§

impl<N: Network> From<Literals<N, TernaryOperation<N>, 3>> for Instruction<N>

Source§

fn from(operation: Ternary<N>) -> Self

Converts to this type from the input type.
Source§

impl<N: Network> From<Literals<N, XorOperation<N>, 2>> for Instruction<N>

Source§

fn from(operation: Xor<N>) -> Self

Converts to this type from the input type.
Source§

impl<N: Network> From<SignVerify<N>> for Instruction<N>

Source§

fn from(operation: SignVerify<N>) -> Self

Converts to this type from the input type.
Source§

impl<N: Network> FromBytes for Instruction<N>

Source§

fn read_le<R: Read>(reader: R) -> IoResult<Self>

Reads Self from reader as little-endian bytes.
Source§

fn from_bytes_le(bytes: &[u8]) -> Result<Self, Error>
where Self: Sized,

Returns Self from a byte array in little-endian order.
Source§

impl<N: Network> FromStr for Instruction<N>

Source§

fn from_str(string: &str) -> Result<Self>

Parses a string into an instruction.

Source§

type Err = Error

The associated error which can be returned from parsing.
Source§

impl<N: Hash + Network> Hash for Instruction<N>

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl<N: Network> InstructionTrait<N> for Instruction<N>

Source§

fn destinations(&self) -> Vec<Register<N>>

Returns the destination registers of the instruction.

Source§

fn is_reserved_opcode(name: &str) -> bool

Returns true if the given name is a reserved opcode.

Source§

impl<N: Network> Parser for Instruction<N>

Source§

fn parse(string: &str) -> ParserResult<'_, Self>

Parses a string into an instruction.

Source§

impl<N: PartialEq + Network> PartialEq for Instruction<N>

Source§

fn eq(&self, other: &Instruction<N>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<N: Network> ToBytes for Instruction<N>

Source§

fn write_le<W: Write>(&self, writer: W) -> IoResult<()>

Writes self into writer as little-endian bytes.
Source§

fn to_bytes_le(&self) -> Result<Vec<u8>, Error>
where Self: Sized,

Returns self as a byte array in little-endian order.
Source§

impl<N: Eq + Network> Eq for Instruction<N>

Source§

impl<N: Network> StructuralPartialEq for Instruction<N>

Auto Trait Implementations§

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, dst: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. 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.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize = _

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

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

Initializes a with the given initializer. Read more
Source§

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

Dereferences the given pointer. Read more
Source§

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

Mutably dereferences the given pointer. Read more
Source§

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> ToSmolStr for T
where T: Display + ?Sized,

Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

default fn to_string(&self) -> String

Converts the given value to a String. 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.
Source§

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

Source§

fn vzip(self) -> V