pub enum AnalyzerResourceAddress {
Static(ResourceAddress),
Dynamic {
blueprint_id: BlueprintId,
named_address: u32,
},
}Expand description
The primary address type used in the static analyzer.
The static analyzer is capable of analyzing more resource movements than just static movements, it’s capable of also analyzing movements of dynamic resources which are resources which were created within the same manifest or transaction.
This type allows for both Static and Dynamic resources to be tracked throughout the
whole codebase.
Variants§
Static(ResourceAddress)
A static resource address of a resource which was created before the manifest being analyzed by the static analyzer.
Dynamic
A dynamic address of a resource which was created within the same manifest which is being analyzed by the analyzer.
Implementations§
Source§impl AnalyzerResourceAddress
impl AnalyzerResourceAddress
Sourcepub fn new_static(address: impl Into<ResourceAddress>) -> Self
pub fn new_static(address: impl Into<ResourceAddress>) -> Self
Creates an AnalyzerResourceAddress for a resource that already exists on-ledger
with a known ResourceAddress.
Sourcepub fn new_dynamic(
blueprint_id: impl Into<BlueprintId>,
named_address: impl Into<ManifestNamedAddress>,
) -> Self
pub fn new_dynamic( blueprint_id: impl Into<BlueprintId>, named_address: impl Into<ManifestNamedAddress>, ) -> Self
Creates an AnalyzerResourceAddress for a resource that is being created within the
manifest currently being analyzed. The resource is identified by its creating blueprint,
the address reservation that will resolve to its final address, and the named address
used to reference it in subsequent manifest instructions.
Sourcepub fn is_fungible(&self) -> bool
pub fn is_fungible(&self) -> bool
Returns true if this resource is fungible. For static addresses, this is determined
from the address’s entity type. For dynamic addresses, this checks whether the creating
blueprint is the [FUNGIBLE_RESOURCE_MANAGER_BLUEPRINT].
Sourcepub fn is_non_fungible(&self) -> bool
pub fn is_non_fungible(&self) -> bool
Returns true if this resource is non-fungible, i.e. not fungible.
Trait Implementations§
Source§impl Clone for AnalyzerResourceAddress
impl Clone for AnalyzerResourceAddress
Source§fn clone(&self) -> AnalyzerResourceAddress
fn clone(&self) -> AnalyzerResourceAddress
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for AnalyzerResourceAddress
impl Debug for AnalyzerResourceAddress
Source§impl<D: Decoder<ManifestCustomValueKind>> Decode<ManifestCustomValueKind, D> for AnalyzerResourceAddress
impl<D: Decoder<ManifestCustomValueKind>> Decode<ManifestCustomValueKind, D> for AnalyzerResourceAddress
Source§fn decode_body_with_value_kind(
decoder: &mut D,
value_kind: ValueKind<ManifestCustomValueKind>,
) -> Result<Self, DecodeError>
fn decode_body_with_value_kind( decoder: &mut D, value_kind: ValueKind<ManifestCustomValueKind>, ) -> Result<Self, DecodeError>
Source§impl<D: Decoder<ScryptoCustomValueKind>> Decode<ScryptoCustomValueKind, D> for AnalyzerResourceAddress
impl<D: Decoder<ScryptoCustomValueKind>> Decode<ScryptoCustomValueKind, D> for AnalyzerResourceAddress
Source§fn decode_body_with_value_kind(
decoder: &mut D,
value_kind: ValueKind<ScryptoCustomValueKind>,
) -> Result<Self, DecodeError>
fn decode_body_with_value_kind( decoder: &mut D, value_kind: ValueKind<ScryptoCustomValueKind>, ) -> Result<Self, DecodeError>
Source§impl Describe<ScryptoCustomTypeKind> for AnalyzerResourceAddress
impl Describe<ScryptoCustomTypeKind> for AnalyzerResourceAddress
Source§const TYPE_ID: RustTypeId
const TYPE_ID: RustTypeId
TYPE_ID should give a unique identifier for its SBOR schema type.
An SBOR schema type capture details about the SBOR payload, how it should be interpreted, validated and displayed. Read moreSource§fn type_data() -> TypeData<ScryptoCustomTypeKind, RustTypeId>
fn type_data() -> TypeData<ScryptoCustomTypeKind, RustTypeId>
Source§fn add_all_dependencies(aggregator: &mut TypeAggregator<ScryptoCustomTypeKind>)
fn add_all_dependencies(aggregator: &mut TypeAggregator<ScryptoCustomTypeKind>)
get_local_type_data, we need to ensure that the type and all of its own references
get added to the aggregator. Read moreSource§impl<E: Encoder<ManifestCustomValueKind>> Encode<ManifestCustomValueKind, E> for AnalyzerResourceAddress
impl<E: Encoder<ManifestCustomValueKind>> Encode<ManifestCustomValueKind, E> for AnalyzerResourceAddress
Source§fn encode_value_kind(&self, encoder: &mut E) -> Result<(), EncodeError>
fn encode_value_kind(&self, encoder: &mut E) -> Result<(), EncodeError>
Source§fn encode_body(&self, encoder: &mut E) -> Result<(), EncodeError>
fn encode_body(&self, encoder: &mut E) -> Result<(), EncodeError>
Source§impl<E: Encoder<ScryptoCustomValueKind>> Encode<ScryptoCustomValueKind, E> for AnalyzerResourceAddress
impl<E: Encoder<ScryptoCustomValueKind>> Encode<ScryptoCustomValueKind, E> for AnalyzerResourceAddress
Source§fn encode_value_kind(&self, encoder: &mut E) -> Result<(), EncodeError>
fn encode_value_kind(&self, encoder: &mut E) -> Result<(), EncodeError>
Source§fn encode_body(&self, encoder: &mut E) -> Result<(), EncodeError>
fn encode_body(&self, encoder: &mut E) -> Result<(), EncodeError>
impl Eq for AnalyzerResourceAddress
Source§impl From<ResourceAddress> for AnalyzerResourceAddress
impl From<ResourceAddress> for AnalyzerResourceAddress
Source§fn from(value: ResourceAddress) -> Self
fn from(value: ResourceAddress) -> Self
Source§impl Hash for AnalyzerResourceAddress
impl Hash for AnalyzerResourceAddress
Source§impl PartialEq for AnalyzerResourceAddress
impl PartialEq for AnalyzerResourceAddress
Source§impl SborEnum<ManifestCustomValueKind> for AnalyzerResourceAddress
impl SborEnum<ManifestCustomValueKind> for AnalyzerResourceAddress
fn get_discriminator(&self) -> u8
fn get_length(&self) -> usize
Source§impl SborEnum<ScryptoCustomValueKind> for AnalyzerResourceAddress
impl SborEnum<ScryptoCustomValueKind> for AnalyzerResourceAddress
fn get_discriminator(&self) -> u8
fn get_length(&self) -> usize
impl StructuralPartialEq for AnalyzerResourceAddress
Auto Trait Implementations§
impl Freeze for AnalyzerResourceAddress
impl RefUnwindSafe for AnalyzerResourceAddress
impl Send for AnalyzerResourceAddress
impl Sync for AnalyzerResourceAddress
impl Unpin for AnalyzerResourceAddress
impl UnsafeUnpin for AnalyzerResourceAddress
impl UnwindSafe for AnalyzerResourceAddress
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T, U> ContextualTryInto<U> for Twhere
U: ContextualTryFrom<T>,
impl<T, U> ContextualTryInto<U> for Twhere
U: ContextualTryFrom<T>,
type Error = <U as ContextualTryFrom<T>>::Error
type Context = <U as ContextualTryFrom<T>>::Context
fn contextual_try_into( self, context: &<U as ContextualTryFrom<T>>::Context, ) -> Result<U, <U as ContextualTryFrom<T>>::Error>
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
key and return true if they are equal.