Skip to main content

UnsafeInstDecoder

Struct UnsafeInstDecoder 

Source
pub struct UnsafeInstDecoder<'a> { /* private fields */ }
Expand description

All of the unsafe methods of this type depend on the bytecode being previously validated and instructions being processed correctly. It should not be used outside of the bytecode interpreter.

Implementations§

Source§

impl<'a> UnsafeInstDecoder<'a>

Source

pub fn new(bytecode: &'a [u8]) -> Self

Source

pub unsafe fn opcode(&mut self) -> Opcode

§Safety

Current offset must be in bounds and at valid opcode

Source

pub unsafe fn uvar(&mut self) -> u64

§Safety

Current offset must at valid unsigned integer within bounds

Source

pub unsafe fn ivar(&mut self) -> i64

§Safety

Current offset must at valid signed integer within bounds

Source

pub unsafe fn usize(&mut self) -> usize

§Safety

Current offset must at valid unsigned integer within bounds that fits in usize

Source

pub unsafe fn isize(&mut self) -> isize

§Safety

Current offset must at valid signed integer within bounds that fits in isize

Source

pub unsafe fn seek(&mut self, offset: isize)

§Safety

Target offset must be the start of an in-bounds instruction

Source

pub fn offset(&self) -> usize

Auto Trait Implementations§

§

impl<'a> Freeze for UnsafeInstDecoder<'a>

§

impl<'a> RefUnwindSafe for UnsafeInstDecoder<'a>

§

impl<'a> !Send for UnsafeInstDecoder<'a>

§

impl<'a> !Sync for UnsafeInstDecoder<'a>

§

impl<'a> Unpin for UnsafeInstDecoder<'a>

§

impl<'a> UnsafeUnpin for UnsafeInstDecoder<'a>

§

impl<'a> UnwindSafe for UnsafeInstDecoder<'a>

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> 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, 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.