Enum bytecode::access_path::Addr
source · pub enum Addr {
Constant(BigUint),
Footprint(AccessPath),
}
Expand description
Building block for abstraction of addresses
Variants§
Constant(BigUint)
Account address constant
Footprint(AccessPath)
Account address read from given access path. This represents the value read from the given path at the beginning of the current function
Implementations§
source§impl Addr
impl Addr
sourcepub fn footprint(ap: AccessPath) -> Self
pub fn footprint(ap: AccessPath) -> Self
Create a footprint address from access path ap
sourcepub fn is_constant(&self) -> bool
pub fn is_constant(&self) -> bool
Return true
if self
is a constant
sourcepub fn add_struct_offset(
self,
mid: &ModuleId,
sid: StructId,
types: Vec<Type>
) -> AccessPath
pub fn add_struct_offset( self, mid: &ModuleId, sid: StructId, types: Vec<Type> ) -> AccessPath
Convert this address-typed abstract value A into an access path A/mid::sid::types
sourcepub fn get_concrete_address(&self) -> Option<AccountAddress>
pub fn get_concrete_address(&self) -> Option<AccountAddress>
Convert self
into a concrete AccountAddress
if it is a constant. Returns None
otherwise.
sourcepub fn display<'a>(&'a self, env: &'a FunctionEnv<'_>) -> AddrDisplay<'a>
pub fn display<'a>(&'a self, env: &'a FunctionEnv<'_>) -> AddrDisplay<'a>
Return a wrapper of self
that implements Display
using env
Trait Implementations§
source§impl Ord for Addr
impl Ord for Addr
source§impl PartialEq<Addr> for Addr
impl PartialEq<Addr> for Addr
source§impl PartialOrd<Addr> for Addr
impl PartialOrd<Addr> for Addr
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moreimpl Eq for Addr
impl StructuralEq for Addr
impl StructuralPartialEq for Addr
Auto Trait Implementations§
impl RefUnwindSafe for Addr
impl Send for Addr
impl Sync for Addr
impl Unpin for Addr
impl UnwindSafe for Addr
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.