Struct evmil::analysis::ConcreteState

source ·
pub struct ConcreteState<S, M, T>
where S: EvmStack, M: EvmMemory<Word = S::Word>, T: EvmStorage<Word = S::Word>,
{ /* private fields */ }
Expand description

An EvmState composed from three distinct (and potentially abstract) components: stack, memory and storage.

Implementations§

source§

impl<S, M, T> ConcreteState<S, M, T>
where S: EvmStack + Default, M: EvmMemory<Word = S::Word> + Default, T: EvmStorage<Word = S::Word> + Default,

source

pub fn new() -> Self

Trait Implementations§

source§

impl<S, M, T> Clone for ConcreteState<S, M, T>
where S: EvmStack + Clone, M: EvmMemory<Word = S::Word> + Clone, T: EvmStorage<Word = S::Word> + Clone,

source§

fn clone(&self) -> ConcreteState<S, M, T>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<S, M, T> Debug for ConcreteState<S, M, T>
where S: EvmStack + Debug, M: EvmMemory<Word = S::Word> + Debug, T: EvmStorage<Word = S::Word> + Debug,

source§

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

Formats the value using the given formatter. Read more
source§

impl<S, M, T> Display for ConcreteState<S, M, T>
where S: EvmStack + Default + Display, M: EvmMemory<Word = S::Word> + Default + Display, T: EvmStorage<Word = S::Word> + Default,

source§

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

Formats the value using the given formatter. Read more
source§

impl<S, M, T> EvmState for ConcreteState<S, M, T>
where S: EvmStack, M: EvmMemory<Word = S::Word>, T: EvmStorage<Word = S::Word>,

source§

fn goto(&mut self, pc: usize)

Move program counter to a given (byte) offset within the code section.

§

type Word = <S as EvmStack>::Word

Defines what constitutes a word in this EVM. For example, a concrete evm will use a w256 here whilst an abstract evm will use something that can, for example, describe unknown values.
§

type Stack = S

Defines the stack implementation used in this EVM.
§

type Memory = M

Defines the memory implementation used in this EVM.
§

type Storage = T

Defines the memory implementation used in this EVM.
source§

fn pc(&self) -> usize

Get the program counter. Every EvmState has a statically known pc.
source§

fn stack(&self) -> &Self::Stack

Get read access to the operand stack contained within this state.
source§

fn memory(&self) -> &Self::Memory

Get read access to the scratch memory contained within this state.
source§

fn storage(&self) -> &Self::Storage

Get read access to the persistent storage contained within this state.
source§

fn stack_mut(&mut self) -> &mut Self::Stack

Get write access to the operand stack contained within this state.
source§

fn memory_mut(&mut self) -> &mut Self::Memory

Get write access to the scratch memory contained within this state.
source§

fn storage_mut(&mut self) -> &mut Self::Storage

Get write access to the persistent storage contained within this state.
source§

fn skip(&mut self, n: usize)

Move program counter over n bytes in the next instruction.
source§

impl<S, M, T> PartialEq for ConcreteState<S, M, T>
where S: EvmStack + PartialEq, M: EvmMemory<Word = S::Word> + PartialEq, T: EvmStorage<Word = S::Word> + PartialEq,

source§

fn eq(&self, other: &ConcreteState<S, M, T>) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<S, M, T> StructuralPartialEq for ConcreteState<S, M, T>
where S: EvmStack, M: EvmMemory<Word = S::Word>, T: EvmStorage<Word = S::Word>,

Auto Trait Implementations§

§

impl<S, M, T> Freeze for ConcreteState<S, M, T>
where S: Freeze, M: Freeze, T: Freeze,

§

impl<S, M, T> RefUnwindSafe for ConcreteState<S, M, T>

§

impl<S, M, T> Send for ConcreteState<S, M, T>
where S: Send, M: Send, T: Send,

§

impl<S, M, T> Sync for ConcreteState<S, M, T>
where S: Sync, M: Sync, T: Sync,

§

impl<S, M, T> Unpin for ConcreteState<S, M, T>
where S: Unpin, M: Unpin, T: Unpin,

§

impl<S, M, T> UnwindSafe for ConcreteState<S, M, T>
where S: UnwindSafe, M: UnwindSafe, T: UnwindSafe,

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> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T> ToString for T
where T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

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

§

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.