pub enum Value {
Address(Address),
FixedBytes(Vec<u8>),
Bytes(Vec<u8>),
Int(BigInt),
Uint(BigInt),
Bool(bool),
String(String),
FixedArray(Vec<Value>),
Array(Vec<Value>),
Tuple(Vec<Value>),
}
Expand description
An Ethereum value.
Variants§
Address(Address)
FixedBytes(Vec<u8>)
Bytes(Vec<u8>)
Int(BigInt)
Uint(BigInt)
Bool(bool)
String(String)
FixedArray(Vec<Value>)
Array(Vec<Value>)
Tuple(Vec<Value>)
Implementations§
source§impl Value
impl Value
sourcepub fn as_address(&self) -> Option<Address>
pub fn as_address(&self) -> Option<Address>
Returns the Ethereum value as a address, or None
if the value the
wrong type.
sourcepub fn as_fixed_bytes(&self) -> Option<&[u8]>
pub fn as_fixed_bytes(&self) -> Option<&[u8]>
Returns the Ethereum value as a fixed bytes, or None
if the value the
wrong type.
sourcepub fn as_bytes(&self) -> Option<&[u8]>
pub fn as_bytes(&self) -> Option<&[u8]>
Returns the Ethereum value as a bytes, or None
if the value the wrong
type.
sourcepub fn as_int(&self) -> Option<&BigInt>
pub fn as_int(&self) -> Option<&BigInt>
Returns the Ethereum value as a int, or None
if the value the wrong
type.
sourcepub fn as_uint(&self) -> Option<&BigInt>
pub fn as_uint(&self) -> Option<&BigInt>
Returns the Ethereum value as a uint, or None
if the value the wrong
type.
sourcepub fn as_bool(&self) -> Option<bool>
pub fn as_bool(&self) -> Option<bool>
Returns the Ethereum value as a bool, or None
if the value the wrong
type.
sourcepub fn as_string(&self) -> Option<&str>
pub fn as_string(&self) -> Option<&str>
Returns the Ethereum value as a string, or None
if the value the wrong
type.
sourcepub fn as_fixed_array(&self) -> Option<&[Self]>
pub fn as_fixed_array(&self) -> Option<&[Self]>
Returns the Ethereum value as a fixed array, or None
if the value the
wrong type.
Trait Implementations§
impl Eq for Value
impl StructuralEq for Value
impl StructuralPartialEq for Value
Auto Trait Implementations§
impl RefUnwindSafe for Value
impl !Send for Value
impl !Sync for Value
impl Unpin for Value
impl UnwindSafe for Value
Blanket Implementations§
source§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.