Struct lde::OpCode [] [src]

pub struct OpCode(_);

Byte slice representing an opcode.

Methods

impl OpCode
[src]

[src]

Helps reading immediate and displacement values.

Examples

// mov eax, 0x01010101
let opcode: &lde::OpCode = b"\xB8\x01\x01\x01\x01".into();

// reads the immedate value
let result = opcode.read::<u32>(1);

assert_eq!(result, 0x01010101);

Panics

Panics if offset..offset + sizeof(T) is out of bounds.

[src]

Helps writing immediate and displacement values.

Examples

// mov al, 1
let mut opcode = [0xb0, 0x01];
let opcode: &mut lde::OpCode = (&mut opcode).into();

// change the immediate to 0xff
opcode.write(1, 0xff_u8);

assert_eq!(opcode, &[0xb0, 0xff]);

Panics

Panics if offset..offset + sizeof(T) is out of bounds.

Trait Implementations

impl Eq for OpCode
[src]

impl PartialEq for OpCode
[src]

[src]

This method tests for self and other values to be equal, and is used by ==. Read more

[src]

This method tests for !=.

impl Hash for OpCode
[src]

[src]

Feeds this value into the given [Hasher]. Read more

1.3.0
[src]

Feeds a slice of this type into the given [Hasher]. Read more

impl<'a, T: AsRef<[u8]> + ?Sized> From<&'a T> for &'a OpCode
[src]

[src]

Performs the conversion.

impl<'a, T: AsMut<[u8]> + ?Sized> From<&'a mut T> for &'a mut OpCode
[src]

[src]

Performs the conversion.

impl<'a> From<&'a OpCode> for &'a [u8]
[src]

[src]

Performs the conversion.

impl<'a> From<&'a mut OpCode> for &'a mut [u8]
[src]

[src]

Performs the conversion.

impl Deref for OpCode
[src]

The resulting type after dereferencing.

[src]

Dereferences the value.

impl DerefMut for OpCode
[src]

[src]

Mutably dereferences the value.

impl<T: AsRef<[u8]> + ?Sized> PartialEq<T> for OpCode
[src]

[src]

This method tests for self and other values to be equal, and is used by ==. Read more

1.0.0
[src]

This method tests for !=.

impl Display for OpCode
[src]

[src]

Formats the value using the given formatter. Read more

impl Debug for OpCode
[src]

[src]

Formats the value using the given formatter. Read more

Auto Trait Implementations

impl Send for OpCode

impl Sync for OpCode