pub enum EntityAddr {
System(HashAddr),
Account(HashAddr),
SmartContract(HashAddr),
}
Expand description
The address for an AddressableEntity which contains the 32 bytes and tagging information.
Variants§
System(HashAddr)
The address for a system entity account or contract.
Account(HashAddr)
The address of an entity that corresponds to an Account.
SmartContract(HashAddr)
The address of an entity that corresponds to a Userland smart contract.
Implementations§
Source§impl EntityAddr
impl EntityAddr
Sourcepub const fn new_system(hash_addr: HashAddr) -> Self
pub const fn new_system(hash_addr: HashAddr) -> Self
Constructs a new EntityAddr
for a system entity.
Sourcepub const fn new_account(hash_addr: HashAddr) -> Self
pub const fn new_account(hash_addr: HashAddr) -> Self
Constructs a new EntityAddr
for an Account entity.
Sourcepub const fn new_smart_contract(hash_addr: HashAddr) -> Self
pub const fn new_smart_contract(hash_addr: HashAddr) -> Self
Constructs a new EntityAddr
for a smart contract.
Sourcepub fn new_of_kind(entity_kind: EntityKind, hash_addr: HashAddr) -> Self
pub fn new_of_kind(entity_kind: EntityKind, hash_addr: HashAddr) -> Self
Constructs a new EntityAddr
based on the supplied kind.
Sourcepub fn tag(&self) -> EntityKindTag
pub fn tag(&self) -> EntityKindTag
Returns the tag of the EntityAddr
.
Sourcepub fn is_contract(&self) -> bool
pub fn is_contract(&self) -> bool
Is this a contract entity address?
Sourcepub fn is_account(&self) -> bool
pub fn is_account(&self) -> bool
Is this an account entity address?
Sourcepub fn value(&self) -> HashAddr
pub fn value(&self) -> HashAddr
Returns the 32 bytes of the EntityAddr
.
Sourcepub fn to_formatted_string(&self) -> String
pub fn to_formatted_string(&self) -> String
Returns the formatted String representation of the EntityAddr
.
Sourcepub fn from_formatted_str(input: &str) -> Result<Self, FromStrError>
pub fn from_formatted_str(input: &str) -> Result<Self, FromStrError>
Constructs an EntityAddr
from a formatted String.
pub fn into_smart_contract(&self) -> Option<[u8; 32]>
Trait Implementations§
Source§impl Clone for EntityAddr
impl Clone for EntityAddr
Source§fn clone(&self) -> EntityAddr
fn clone(&self) -> EntityAddr
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl DataSize for EntityAddr
impl DataSize for EntityAddr
Source§const IS_DYNAMIC: bool = true
const IS_DYNAMIC: bool = true
If
true
, the type has a heap size that can vary at runtime, depending on the actual value.Source§const STATIC_HEAP_SIZE: usize = 0usize
const STATIC_HEAP_SIZE: usize = 0usize
The amount of space a value of the type always occupies. If
IS_DYNAMIC
is false, this is
the total amount of heap memory occupied by the value. Otherwise this is a lower bound.Source§fn estimate_heap_size(&self) -> usize
fn estimate_heap_size(&self) -> usize
Estimates the size of heap memory taken up by this value. Read more
Source§impl Debug for EntityAddr
impl Debug for EntityAddr
Source§impl<'de> Deserialize<'de> for EntityAddr
impl<'de> Deserialize<'de> for EntityAddr
Source§fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
Deserialize this value from the given Serde deserializer. Read more
Source§impl Display for EntityAddr
impl Display for EntityAddr
Source§impl Distribution<EntityAddr> for Standard
Available on crate feature testing
only.
impl Distribution<EntityAddr> for Standard
Available on crate feature
testing
only.Source§impl From<EntityAddr> for AddressableEntityHash
impl From<EntityAddr> for AddressableEntityHash
Source§fn from(entity_addr: EntityAddr) -> Self
fn from(entity_addr: EntityAddr) -> Self
Converts to this type from the input type.
Source§impl From<EntityAddr> for Key
impl From<EntityAddr> for Key
Source§fn from(entity_addr: EntityAddr) -> Self
fn from(entity_addr: EntityAddr) -> Self
Converts to this type from the input type.
Source§impl FromBytes for EntityAddr
impl FromBytes for EntityAddr
Source§impl Hash for EntityAddr
impl Hash for EntityAddr
Source§impl JsonSchema for EntityAddr
impl JsonSchema for EntityAddr
Source§fn schema_name() -> String
fn schema_name() -> String
The name of the generated JSON Schema. Read more
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Returns a string that uniquely identifies the schema produced by this type. Read more
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Generates a JSON Schema for this type. Read more
Source§fn is_referenceable() -> bool
fn is_referenceable() -> bool
Whether JSON Schemas generated for this type should be re-used where possible using the
$ref
keyword. Read moreSource§impl Ord for EntityAddr
impl Ord for EntityAddr
Source§fn cmp(&self, other: &EntityAddr) -> Ordering
fn cmp(&self, other: &EntityAddr) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq for EntityAddr
impl PartialEq for EntityAddr
Source§impl PartialOrd for EntityAddr
impl PartialOrd for EntityAddr
Source§impl Serialize for EntityAddr
impl Serialize for EntityAddr
Source§impl ToBytes for EntityAddr
impl ToBytes for EntityAddr
Source§fn serialized_length(&self) -> usize
fn serialized_length(&self) -> usize
Returns the length of the
Vec<u8>
which would be returned from a successful call to
to_bytes()
or into_bytes()
. The data is not actually serialized, so this call is
relatively cheap.impl Copy for EntityAddr
impl Eq for EntityAddr
impl StructuralPartialEq for EntityAddr
Auto Trait Implementations§
impl Freeze for EntityAddr
impl RefUnwindSafe for EntityAddr
impl Send for EntityAddr
impl Sync for EntityAddr
impl Unpin for EntityAddr
impl UnwindSafe for EntityAddr
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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