pub struct Instruction { /* private fields */ }
Expand description

A version of Opcode that can be used without unnecessary branching

Implementations

Size of an opcode in bytes

Extracts fields from a raw instruction

Opcode

Register A

Register B

Register C

Register D

Immediate with 6 bits

Immediate with 12 bits

Immediate with 18 bits

Immediate with 24 bits

Create a Instruction from a slice of bytes

Safety

The caller must ensure that the slice is has at least Self::LEN bytes.

Convert the opcode to bytes representation

Splits a Word into two Instruction that can be used to construct crate::Opcode

Convert the instruction into its internal representation

(repr, $ra, $rb, $rc, $rd, immediate)

Available on crate feature std only.

Create a Instruction from a slice of bytes

This function will fail if the length of the bytes is smaller than Instruction::LEN.

Available on crate feature std only.

Create a set of Instruction from an iterator of bytes

If not padded to Self::LEN, will consume the unaligned bytes but won’t try to parse an instruction from them.

Trait Implementations

Generate an arbitrary value of Self from the given unstructured data. Read more
Generate an arbitrary value of Self from the entirety of the given unstructured data. Read more
Get a size hint for how many bytes out of an Unstructured this type needs to construct itself. Read more
Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more
Returns the “default value” for a type. Read more
Deserialize this value from the given Serde deserializer. Read more
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Creates a value from an iterator. Read more
Creates a value from an iterator. Read more
Feeds this value into the given Hasher. Read more
Feeds a slice of this type into the given Hasher. Read more
This method tests for self and other values to be equal, and is used by ==. Read more
This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason. Read more
Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

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

The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.