Struct VM

Source
pub(crate) struct VM<'a, T: Debug> {
    pub reader: MemReaderRef<'a>,
    pub data: Vec<T>,
    pub stack: Vec<u64>,
    pub strs: Vec<T>,
    pub vars: HashMap<T, T>,
    pub flags: HashMap<T, bool>,
    pub mess: BTreeSet<T>,
    pub names: HashMap<T, T>,
}
Available on crate feature escude only.

Fields§

§reader: MemReaderRef<'a>§data: Vec<T>§stack: Vec<u64>§strs: Vec<T>§vars: HashMap<T, T>§flags: HashMap<T, bool>§mess: BTreeSet<T>§names: HashMap<T, T>

Implementations§

Source§

impl<'a, T> VM<'a, T>
where MemReaderRef<'a>: ReadParam<T>, T: TryInto<u64> + Default + Eq + Ord + Copy + Debug + Display + Hash + From<u8> + Neg<Output = T> + Add<Output = T> + Sub<Output = T> + Mul<Output = T> + Div<Output = T> + Rem<Output = T> + Not<Output = T> + BitAnd<Output = T> + BitOr<Output = T> + BitXor<Output = T> + Shr<Output = T> + Shl<Output = T>, Error: From<<T as TryInto<u64>>::Error>,

Source

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

Source

pub fn pop_data(&mut self) -> Result<T>

Source

fn pop_stack(&mut self) -> Result<u64>

Source

pub fn run(&mut self, custom_ops: Option<Box<dyn CustomOps<T>>>) -> Result<()>

Source

pub fn skip_n_params(&mut self, n: u64, nbreak: bool) -> Result<bool>

Source

pub fn skip_params(&mut self, nbreak: bool) -> Result<bool>

Source

pub fn read_params(&mut self, ncount: Option<u64>) -> Result<Vec<T>>

Trait Implementations§

Source§

impl<'a, T: Debug + Debug> Debug for VM<'a, T>

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'a, T> Freeze for VM<'a, T>

§

impl<'a, T> RefUnwindSafe for VM<'a, T>
where T: RefUnwindSafe,

§

impl<'a, T> Send for VM<'a, T>
where T: Send,

§

impl<'a, T> Sync for VM<'a, T>
where T: Sync,

§

impl<'a, T> Unpin for VM<'a, T>
where T: Unpin,

§

impl<'a, T> UnwindSafe for VM<'a, T>

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> 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> Same for T

Source§

type Output = T

Should always be Self
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

Source§

impl<T> AnyDebug for T
where T: Debug + Any,

Source§

impl<T> ErasedDestructor for T
where T: 'static,