ResourceAddress

Struct ResourceAddress 

Source
pub struct ResourceAddress(/* private fields */);
Expand description

Address to a global resource

Implementations§

Source§

impl ResourceAddress

Source

pub const fn new_or_panic(raw: [u8; 30]) -> ResourceAddress

Source

pub unsafe fn new_unchecked(raw: [u8; 30]) -> ResourceAddress

§Safety

This function doesn’t check that the provided NodeId has the correct EntityType for this address type. The result of calling this constructor function is that you may end up with an address whose NodeId is incorrect (e.g., a NodeId of a resource on a PackageAddress)

Source

pub fn to_vec(&self) -> Vec<u8>

Source

pub fn as_bytes(&self) -> &[u8]

Source

pub fn as_node_id(&self) -> &NodeId

Source

pub const fn into_node_id(self) -> NodeId

Source

pub fn try_from_hex(s: &str) -> Option<ResourceAddress>

Source

pub fn try_from_bech32( decoder: &AddressBech32Decoder, s: &str, ) -> Option<ResourceAddress>

Source

pub fn to_hex(&self) -> String

Source

pub fn is_fungible(&self) -> bool

Trait Implementations§

Source§

impl AsMut<ResourceAddress> for AccountResourcePreferenceKeyPayload

Source§

fn as_mut(&mut self) -> &mut ResourceAddress

Converts this type into a mutable reference of the (usually inferred) input type.
Source§

impl AsMut<ResourceAddress> for AccountResourceVaultKeyPayload

Source§

fn as_mut(&mut self) -> &mut ResourceAddress

Converts this type into a mutable reference of the (usually inferred) input type.
Source§

impl AsRef<[u8]> for ResourceAddress

Source§

fn as_ref(&self) -> &[u8]

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl AsRef<NodeId> for ResourceAddress

Source§

fn as_ref(&self) -> &NodeId

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl AsRef<ResourceAddress> for AccountResourcePreferenceKeyPayload

Source§

fn as_ref(&self) -> &ResourceAddress

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl AsRef<ResourceAddress> for AccountResourceVaultKeyPayload

Source§

fn as_ref(&self) -> &ResourceAddress

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl Categorize<ManifestCustomValueKind> for ResourceAddress

Source§

impl Categorize<ScryptoCustomValueKind> for ResourceAddress

Source§

impl Clone for ResourceAddress

Source§

fn clone(&self) -> ResourceAddress

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<'a> ContextualDisplay<AddressDisplayContext<'a>> for ResourceAddress

Source§

type Error = AddressBech32EncodeError

Source§

fn contextual_format( &self, f: &mut Formatter<'_>, context: &AddressDisplayContext<'a>, ) -> Result<(), <ResourceAddress as ContextualDisplay<AddressDisplayContext<'a>>>::Error>

Formats the value to the given fmt::Write buffer, making use of the provided context. See also format, which is typically easier to use, as it takes an Into<Context> instead of a &Context.
Source§

fn format<TContext>( &self, f: &mut Formatter<'_>, context: TContext, ) -> Result<(), Self::Error>
where TContext: Into<Context>,

Formats the value to the given fmt::Write buffer, making use of the provided context. See also contextual_format, which takes a &Context instead of an Into<Context>. Read more
Source§

fn display<'a, TContext>( &'a self, context: TContext, ) -> ContextDisplayable<'a, Self, Context>
where TContext: Into<Context>,

Returns an object implementing fmt::Display, which can be used in a format! style macro. Read more
Source§

fn debug_as_display<'a, TContext>( &'a self, context: TContext, ) -> ContextDebuggableAsDisplay<'a, Self, Context>
where TContext: Into<Context>,

Returns an object implementing fmt::Debug using the contextual display implementation. Read more
Source§

fn to_string<TContext>(&self, context: TContext) -> String
where TContext: Into<Context>,

Source§

impl Debug for ResourceAddress

Source§

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

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

impl<D> Decode<ManifestCustomValueKind, D> for ResourceAddress

Source§

fn decode_body_with_value_kind( decoder: &mut D, value_kind: ValueKind<ManifestCustomValueKind>, ) -> Result<ResourceAddress, DecodeError>

Decodes the type from the decoder, which should match a preloaded value kind. Read more
Source§

impl<D> Decode<ScryptoCustomValueKind, D> for ResourceAddress

Source§

fn decode_body_with_value_kind( decoder: &mut D, value_kind: ValueKind<ScryptoCustomValueKind>, ) -> Result<ResourceAddress, DecodeError>

Decodes the type from the decoder, which should match a preloaded value kind. Read more
Source§

impl Describe<ScryptoCustomTypeKind> for ResourceAddress

Source§

const TYPE_ID: RustTypeId

The 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 more
Source§

fn type_data() -> TypeData<ScryptoCustomTypeKind, RustTypeId>

Returns the local schema for the given type. Read more
Source§

fn add_all_dependencies(aggregator: &mut TypeAggregator<C>)

For each type referenced in get_local_type_data, we need to ensure that the type and all of its own references get added to the aggregator. Read more
Source§

impl<E> Encode<ManifestCustomValueKind, E> for ResourceAddress

Source§

fn encode_value_kind(&self, encoder: &mut E) -> Result<(), EncodeError>

Encodes the SBOR value’s kind to the encoder
Source§

fn encode_body(&self, encoder: &mut E) -> Result<(), EncodeError>

Encodes the SBOR body of the type to the encoder. Read more
Source§

impl<E> Encode<ScryptoCustomValueKind, E> for ResourceAddress

Source§

fn encode_value_kind(&self, encoder: &mut E) -> Result<(), EncodeError>

Encodes the SBOR value’s kind to the encoder
Source§

fn encode_body(&self, encoder: &mut E) -> Result<(), EncodeError>

Encodes the SBOR body of the type to the encoder. Read more
Source§

impl From<ResourceAddress> for [u8; 30]

Source§

fn from(val: ResourceAddress) -> [u8; 30]

Converts to this type from the input type.
Source§

impl From<ResourceAddress> for AccountResourcePreferenceKeyPayload

Source§

fn from(value: ResourceAddress) -> AccountResourcePreferenceKeyPayload

Converts to this type from the input type.
Source§

impl From<ResourceAddress> for AccountResourceVaultKeyPayload

Source§

fn from(value: ResourceAddress) -> AccountResourceVaultKeyPayload

Converts to this type from the input type.
Source§

impl From<ResourceAddress> for CompositeRequirement

Source§

fn from(resource_address: ResourceAddress) -> CompositeRequirement

Converts to this type from the input type.
Source§

impl From<ResourceAddress> for FungibleResourceManager

Source§

fn from(value: ResourceAddress) -> FungibleResourceManager

Converts to this type from the input type.
Source§

impl From<ResourceAddress> for GlobalAddress

Source§

fn from(value: ResourceAddress) -> GlobalAddress

Converts to this type from the input type.
Source§

impl From<ResourceAddress> for ManifestAddress

Source§

fn from(value: ResourceAddress) -> ManifestAddress

Converts to this type from the input type.
Source§

impl From<ResourceAddress> for ManifestGlobalAddress

Source§

fn from(value: ResourceAddress) -> ManifestGlobalAddress

Converts to this type from the input type.
Source§

impl From<ResourceAddress> for ManifestResourceAddress

Source§

fn from(value: ResourceAddress) -> ManifestResourceAddress

Converts to this type from the input type.
Source§

impl From<ResourceAddress> for NodeId

Source§

fn from(value: ResourceAddress) -> NodeId

Converts to this type from the input type.
Source§

impl From<ResourceAddress> for NonFungibleResourceManager

Source§

fn from(value: ResourceAddress) -> NonFungibleResourceManager

Converts to this type from the input type.
Source§

impl From<ResourceAddress> for Reference

Source§

fn from(value: ResourceAddress) -> Reference

Converts to this type from the input type.
Source§

impl From<ResourceAddress> for ResourceManager

Source§

fn from(value: ResourceAddress) -> ResourceManager

Converts to this type from the input type.
Source§

impl From<ResourceAddress> for ResourceOrNonFungible

Source§

fn from(resource_address: ResourceAddress) -> ResourceOrNonFungible

Converts to this type from the input type.
Source§

impl Hash for ResourceAddress

Source§

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

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 IntoManifestAddress for ResourceAddress

Source§

impl KeyValueKeyContentSource<AccountResourcePreferenceKeyPayload> for ResourceAddress

Source§

impl KeyValueKeyContentSource<AccountResourceVaultKeyPayload> for ResourceAddress

Source§

impl Ord for ResourceAddress

Source§

fn cmp(&self, other: &ResourceAddress) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · Source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · Source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · Source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized,

Restrict a value to a certain interval. Read more
Source§

impl PartialEq for ResourceAddress

Source§

fn eq(&self, other: &ResourceAddress) -> 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 PartialOrd for ResourceAddress

Source§

fn partial_cmp(&self, other: &ResourceAddress) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · Source§

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

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · Source§

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

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · Source§

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

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · Source§

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

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl ToMetadataEntry for ResourceAddress

Source§

impl TryFrom<&[u8]> for ResourceAddress

Source§

type Error = ParseResourceAddressError

The type returned in the event of a conversion error.
Source§

fn try_from( slice: &[u8], ) -> Result<ResourceAddress, <ResourceAddress as TryFrom<&[u8]>>::Error>

Performs the conversion.
Source§

impl TryFrom<[u8; 30]> for ResourceAddress

Source§

type Error = ParseResourceAddressError

The type returned in the event of a conversion error.
Source§

fn try_from( value: [u8; 30], ) -> Result<ResourceAddress, <ResourceAddress as TryFrom<[u8; 30]>>::Error>

Performs the conversion.
Source§

impl TryFrom<GlobalAddress> for ResourceAddress

Source§

type Error = ParseResourceAddressError

The type returned in the event of a conversion error.
Source§

fn try_from( address: GlobalAddress, ) -> Result<ResourceAddress, <ResourceAddress as TryFrom<GlobalAddress>>::Error>

Performs the conversion.
Source§

impl TryFrom<NodeId> for ResourceAddress

Source§

type Error = ParseResourceAddressError

The type returned in the event of a conversion error.
Source§

fn try_from( node_id: NodeId, ) -> Result<ResourceAddress, <ResourceAddress as TryFrom<NodeId>>::Error>

Performs the conversion.
Source§

impl Copy for ResourceAddress

Source§

impl Eq for ResourceAddress

Source§

impl StructuralPartialEq for ResourceAddress

Auto Trait Implementations§

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<U> As for U

Source§

fn as_<T>(self) -> T
where T: CastFrom<U>,

Casts self to type T. The semantics of numeric casting with the as operator are followed, so <T as As>::as_::<U> can be used in the same way as T as U for numeric conversions. Read more
Source§

impl<T> Base32Len for T
where T: AsRef<[u8]>,

Source§

fn base32_len(&self) -> usize

Calculate the base32 serialized length
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> CheckBase32<Vec<u5>> for T
where T: AsRef<[u8]>,

Source§

type Err = Error

Error type if conversion fails
Source§

fn check_base32(self) -> Result<Vec<u5>, <T as CheckBase32<Vec<u5>>>::Err>

Check if all values are in range and return array-like struct of u5 values
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<Q, K> Comparable<K> for Q
where Q: Ord + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn compare(&self, key: &K) -> Ordering

Compare self to key and return their ordering.
Source§

impl<T, U> ContextualTryInto<U> for T
where U: ContextualTryFrom<T>,

Source§

impl<T> Downcast for T
where T: Any,

Source§

fn into_any(self: Box<T>) -> Box<dyn Any>

Convert Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.
Source§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

Convert Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be further downcast into Rc<ConcreteType> where ConcreteType implements Trait.
Source§

fn as_any(&self) -> &(dyn Any + 'static)

Convert &Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &Any’s vtable from &Trait’s.
Source§

fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)

Convert &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s.
Source§

impl<T> DowncastSync for T
where T: Any + Send + Sync,

Source§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send>

Convert Arc<Trait> (where Trait: Downcast) to Arc<Any>. Arc<Any> can then be further downcast into Arc<ConcreteType> where ConcreteType implements Trait.
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

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
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
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> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
Source§

impl<X, Y> LabelledResolve<Y> for X
where Y: LabelledResolveFrom<X>,

Source§

fn labelled_resolve( self, resolver: &impl LabelResolver<<Y as LabelledResolvable>::ResolverOutput>, ) -> Y

Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> ReferencedManifestGlobalAddress for T

Source§

impl<T> ReferencedManifestResourceAddress for T

Source§

impl<A, E> ResolvableStaticManifestResourceAddress for A
where A: TryInto<ManifestResourceAddress, Error = E>, E: Debug,

Source§

impl<X, Y> Resolve<Y> for X
where Y: ResolveFrom<X>,

Source§

fn resolve(self) -> Y

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToBase32 for T
where T: AsRef<[u8]>,

Source§

fn write_base32<W>(&self, writer: &mut W) -> Result<(), <W as WriteBase32>::Err>
where W: WriteBase32,

Encode as base32 and write it to the supplied writer Implementations shouldn’t allocate.
Source§

fn to_base32(&self) -> Vec<u5>

Convert Self to base32 vector
Source§

impl<T> ToHex for T
where T: AsRef<[u8]>,

Source§

fn encode_hex<U>(&self) -> U
where U: FromIterator<char>,

Encode the hex strict representing self into the result. Lower case letters are used (e.g. f9b4ca)
Source§

fn encode_hex_upper<U>(&self) -> U
where U: FromIterator<char>,

Encode the hex strict representing self into the result. Upper case letters are used (e.g. F9B4CA)
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, 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<T> ManifestCategorize for T

Source§

impl<T> ManifestDecode for T

Source§

impl<T> ManifestEncode for T

Source§

impl<T> ScryptoCategorize for T

Source§

impl<T> ScryptoDecode for T

Source§

impl<T> ScryptoDescribe for T

Source§

impl<T> ScryptoEncode for T

Source§

impl<T> ScryptoSbor for T

Source§

impl<X, T> VecDecode<X> for T
where X: CustomValueKind, T: for<'a> Decode<X, VecDecoder<'a, X>>,

Source§

impl<X, T> VecEncode<X> for T
where X: CustomValueKind, T: for<'a> Encode<X, VecEncoder<'a, X>> + ?Sized,