pub struct Instructions(/* private fields */);Expand description
A sequence of bytecode instructions.
Instructions are represented as a byte vector where each instruction consists of an opcode byte followed by zero or more operand bytes. All multi-byte operands are encoded in big-endian format.
Implementations§
Source§impl Instructions
impl Instructions
Sourcepub fn from_bytes(bytes: Vec<u8>) -> Self
pub fn from_bytes(bytes: Vec<u8>) -> Self
Creates an instruction sequence from a byte vector.
Sourcepub fn extend_from_bytes(&mut self, bytes: &[u8])
pub fn extend_from_bytes(&mut self, bytes: &[u8])
Appends raw bytes to this instruction sequence.
Sourcepub fn replace_bytes(&mut self, pos: usize, bytes: &[u8])
pub fn replace_bytes(&mut self, pos: usize, bytes: &[u8])
Replaces bytes in the instruction stream starting at pos.
Used by the compiler to patch forward jump targets after the jump destination is known.
Trait Implementations§
Source§impl AsRef<[u8]> for Instructions
impl AsRef<[u8]> for Instructions
Source§impl Clone for Instructions
impl Clone for Instructions
Source§fn clone(&self) -> Instructions
fn clone(&self) -> Instructions
Returns a duplicate 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 Debug for Instructions
impl Debug for Instructions
Source§impl Default for Instructions
impl Default for Instructions
Source§fn default() -> Instructions
fn default() -> Instructions
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for Instructions
impl<'de> Deserialize<'de> for Instructions
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 Display for Instructions
impl Display for Instructions
Source§impl From<Instructions> for Vec<u8>
impl From<Instructions> for Vec<u8>
Source§fn from(ins: Instructions) -> Self
fn from(ins: Instructions) -> Self
Converts to this type from the input type.
Source§impl PartialEq for Instructions
impl PartialEq for Instructions
Source§impl Serialize for Instructions
impl Serialize for Instructions
impl Eq for Instructions
impl StructuralPartialEq for Instructions
Auto Trait Implementations§
impl Freeze for Instructions
impl RefUnwindSafe for Instructions
impl Send for Instructions
impl Sync for Instructions
impl Unpin for Instructions
impl UnsafeUnpin for Instructions
impl UnwindSafe for Instructions
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§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.