Expr

Struct Expr 

Source
pub struct Expr { /* private fields */ }
Expand description

Representation of an expression tree (ex. add(2, sub(9, 4)))

Implementations§

Source§

impl Expr

Source

pub fn address() -> Self

Create an Expr representing address (0x30).

Source

pub fn origin() -> Self

Create an Expr representing origin (0x32).

Source

pub fn caller() -> Self

Create an Expr representing caller (0x33).

Source

pub fn call_value() -> Self

Create an Expr representing callvalue (0x34).

Source

pub fn call_data_size() -> Self

Create an Expr representing calldatasize (0x36).

Source

pub fn code_size() -> Self

Create an Expr representing codesize (0x38).

Source

pub fn gas_price() -> Self

Create an Expr representing gasprice (0x3a).

Source

pub fn return_data_size() -> Self

Create an Expr representing returndatasize (0x3d).

Source

pub fn coinbase() -> Self

Create an Expr representing coinbase (0x41).

Source

pub fn timestamp() -> Self

Create an Expr representing timestamp (0x42).

Source

pub fn number() -> Self

Create an Expr representing number (0x43).

Source

pub fn difficulty() -> Self

Create an Expr representing difficulty (0x44).

Source

pub fn gas_limit() -> Self

Create an Expr representing gaslimit (0x45).

Source

pub fn chain_id() -> Self

Create an Expr representing chainid (0x46).

Source

pub fn self_balance() -> Self

Create an Expr representing selfbalance (0x47).

Source

pub fn base_fee() -> Self

Create an Expr representing basefee (0x48).

Source

pub fn pc(offset: u16) -> Self

Create an Expr representing pc (0x58).

Source

pub fn m_size() -> Self

Create an Expr representing msize (0x59).

Source

pub fn gas() -> Self

Create an Expr representing gas (0x5a).

Source

pub fn create(value: &Self, offset: &Self, length: &Self) -> Self

Create an Expr representing create (0xf0).

Source

pub fn create2(value: &Self, offset: &Self, length: &Self, salt: &Self) -> Self

Create an Expr representing create2 (0xf5).

Source

pub fn call_code( gas: &Self, addr: &Self, value: &Self, args_offset: &Self, args_len: &Self, ret_offset: &Self, ret_len: &Self, ) -> Self

Create an Expr representing callcode (0xf2).

Source

pub fn call( gas: &Self, addr: &Self, value: &Self, args_offset: &Self, args_len: &Self, ret_offset: &Self, ret_len: &Self, ) -> Self

Create an Expr representing call (0xf1).

Source

pub fn static_call( gas: &Self, addr: &Self, args_offset: &Self, args_len: &Self, ret_offset: &Self, ret_len: &Self, ) -> Self

Create an Expr representing staticcall (0xfa).

Source

pub fn delegate_call( gas: &Self, addr: &Self, args_offset: &Self, args_len: &Self, ret_offset: &Self, ret_len: &Self, ) -> Self

Create an Expr representing delegatecall (0xf4).

Source

pub fn add(&self, rhs: &Self) -> Self

Create an Expr representing add (0x01).

Source

pub fn sub(&self, rhs: &Self) -> Self

Create an Expr representing sub (0x03).

Source

pub fn mul(&self, rhs: &Self) -> Self

Create an Expr representing mul (0x02).

Source

pub fn div(&self, rhs: &Self) -> Self

Create an Expr representing div (0x04).

Source

pub fn s_div(&self, rhs: &Self) -> Self

Create an Expr representing sdiv (0x05).

Source

pub fn modulo(&self, rhs: &Self) -> Self

Create an Expr representing mod (0x06).

Source

pub fn s_modulo(&self, rhs: &Self) -> Self

Create an Expr representing smod (0x07).

Source

pub fn add_mod(&self, add: &Self, modulo: &Self) -> Self

Create an Expr representing addmod (0x08).

Source

pub fn mul_mod(&self, mul: &Self, modulo: &Self) -> Self

Create an Expr representing mulmod (0x09).

Source

pub fn exp(&self, rhs: &Self) -> Self

Create an Expr representing exp (0x0a).

Source

pub fn lt(&self, rhs: &Self) -> Self

Create an Expr representing lt (0x10).

Source

pub fn gt(&self, rhs: &Self) -> Self

Create an Expr representing gt (0x11).

Source

pub fn s_lt(&self, rhs: &Self) -> Self

Create an Expr representing slt (0x12).

Source

pub fn s_gt(&self, rhs: &Self) -> Self

Create an Expr representing sgt (0x13).

Source

pub fn is_eq(&self, rhs: &Self) -> Self

Create an Expr representing eq (0x14).

Source

pub fn and(&self, rhs: &Self) -> Self

Create an Expr representing and (0x16).

Source

pub fn or(&self, rhs: &Self) -> Self

Create an Expr representing or (0x17).

Source

pub fn xor(&self, rhs: &Self) -> Self

Create an Expr representing xor (0x18).

Source

pub fn byte(&self, value: &Self) -> Self

Create an Expr representing byte (0x1a).

Source

pub fn shl(&self, rhs: &Self) -> Self

Create an Expr representing shl (0x1b).

Source

pub fn shr(&self, value: &Self) -> Self

Create an Expr representing shr (0x1c).

Source

pub fn sar(&self, rhs: &Self) -> Self

Create an Expr representing sar (0x1d).

Source

pub fn keccak256(offset: &Self, len: &Self) -> Self

Create an Expr representing keccak256 (0x20).

Source

pub fn sign_extend(&self, b: &Self) -> Self

Create an Expr representing signextend (0x0b).

Source

pub fn is_zero(&self) -> Self

Create an Expr representing iszero (0x15).

Source

pub fn not(&self) -> Self

Create an Expr representing not (0x19).

Source

pub fn block_hash(&self) -> Self

Create an Expr representing blockhash (0x40).

Source

pub fn balance(&self) -> Self

Create an Expr representing balance (0x31).

Source

pub fn call_data_load(&self) -> Self

Create an Expr representing calldataload (0x35).

Source

pub fn ext_code_size(&self) -> Self

Create an Expr representing extcodesize (0x3b).

Source

pub fn ext_code_hash(&self) -> Self

Create an Expr representing extcodehash (0x3f).

Source

pub fn m_load(&self) -> Self

Create an Expr representing mload (0x51).

Source

pub fn s_load(&self) -> Self

Create an Expr representing sload (0x54).

Source

pub fn as_var(&self) -> Option<Var>

If this expression represents a single Var instance, return it. Otherwise return None.

Source

pub fn constant<A>(arr: A) -> Self
where A: AsRef<[u8]>,

Create an Expr representing a constant value.

Source§

impl Expr

Source

pub fn walk<V>(&self, visitor: &mut V) -> Result<(), V::Error>
where V: Visit,

Traverse the expression’s tree, calling the appropriate functions on visitor.

Trait Implementations§

Source§

impl Clone for Expr

Source§

fn clone(&self) -> Expr

Returns a duplicate 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 Debug for Expr

Source§

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

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

impl Display for Expr

Source§

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

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

impl From<Var> for Expr

Source§

fn from(v: Var) -> Expr

Converts to this type from the input type.
Source§

impl Hash for Expr

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for Expr

Source§

fn eq(&self, other: &Expr) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Eq for Expr

Source§

impl StructuralPartialEq for Expr

Auto Trait Implementations§

§

impl Freeze for Expr

§

impl RefUnwindSafe for Expr

§

impl Send for Expr

§

impl Sync for Expr

§

impl Unpin for Expr

§

impl UnwindSafe for Expr

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

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

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§

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

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