Struct staging_xcm_builder::test_utils::MultiAsset
source · pub struct MultiAsset {
pub id: AssetId,
pub fun: Fungibility,
}Expand description
Either an amount of a single fungible asset, or a single well-identified non-fungible asset.
Fields§
§id: AssetIdThe overall asset identity (aka class, in the case of a non-fungible).
fun: FungibilityThe fungibility of the asset, which contains either the amount (in the case of a fungible asset) or the instance ID, the secondary asset identifier.
Implementations§
source§impl MultiAsset
impl MultiAsset
pub fn is_fungible(&self, maybe_id: Option<AssetId>) -> bool
pub fn is_non_fungible(&self, maybe_id: Option<AssetId>) -> bool
sourcepub fn prepend_with(&mut self, prepend: &MultiLocation) -> Result<(), ()>
pub fn prepend_with(&mut self, prepend: &MultiLocation) -> Result<(), ()>
Prepend a MultiLocation to a concrete asset, giving it a new root location.
sourcepub fn reanchor(
&mut self,
target: &MultiLocation,
context: Junctions
) -> Result<(), ()>
pub fn reanchor( &mut self, target: &MultiLocation, context: Junctions ) -> Result<(), ()>
Mutate the location of the asset identifier if concrete, giving it the same location
relative to a target context. The local context is provided as context.
sourcepub fn reanchored(
self,
target: &MultiLocation,
context: Junctions
) -> Result<MultiAsset, ()>
pub fn reanchored( self, target: &MultiLocation, context: Junctions ) -> Result<MultiAsset, ()>
Mutate the location of the asset identifier if concrete, giving it the same location
relative to a target context. The local context is provided as context.
sourcepub fn contains(&self, inner: &MultiAsset) -> bool
pub fn contains(&self, inner: &MultiAsset) -> bool
Returns true if self is a super-set of the given inner asset.
Trait Implementations§
source§impl Clone for MultiAsset
impl Clone for MultiAsset
source§fn clone(&self) -> MultiAsset
fn clone(&self) -> MultiAsset
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moresource§impl<T: Get<(MultiAssetFilter, MultiLocation)>> ContainsPair<MultiAsset, MultiLocation> for Case<T>
impl<T: Get<(MultiAssetFilter, MultiLocation)>> ContainsPair<MultiAsset, MultiLocation> for Case<T>
source§fn contains(asset: &MultiAsset, origin: &MultiLocation) -> bool
fn contains(asset: &MultiAsset, origin: &MultiLocation) -> bool
true if this “contains” the pair-value (a, b).source§impl ContainsPair<MultiAsset, MultiLocation> for NativeAsset
impl ContainsPair<MultiAsset, MultiLocation> for NativeAsset
source§fn contains(asset: &MultiAsset, origin: &MultiLocation) -> bool
fn contains(asset: &MultiAsset, origin: &MultiLocation) -> bool
true if this “contains” the pair-value (a, b).source§impl Debug for MultiAsset
impl Debug for MultiAsset
source§impl Decode for MultiAsset
impl Decode for MultiAsset
source§fn decode<__CodecInputEdqy>(
__codec_input_edqy: &mut __CodecInputEdqy
) -> Result<MultiAsset, Error>where
__CodecInputEdqy: Input,
fn decode<__CodecInputEdqy>(
__codec_input_edqy: &mut __CodecInputEdqy
) -> Result<MultiAsset, Error>where
__CodecInputEdqy: Input,
source§fn decode_into<I>(
input: &mut I,
dst: &mut MaybeUninit<Self>
) -> Result<DecodeFinished, Error>where
I: Input,
fn decode_into<I>(
input: &mut I,
dst: &mut MaybeUninit<Self>
) -> Result<DecodeFinished, Error>where
I: Input,
source§impl<'de> Deserialize<'de> for MultiAsset
impl<'de> Deserialize<'de> for MultiAsset
source§fn deserialize<__D>(
__deserializer: __D
) -> Result<MultiAsset, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D
) -> Result<MultiAsset, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
source§impl Encode for MultiAsset
impl Encode for MultiAsset
source§fn size_hint(&self) -> usize
fn size_hint(&self) -> usize
source§fn encode_to<__CodecOutputEdqy>(
&self,
__codec_dest_edqy: &mut __CodecOutputEdqy
)
fn encode_to<__CodecOutputEdqy>( &self, __codec_dest_edqy: &mut __CodecOutputEdqy )
source§fn using_encoded<R, F>(&self, f: F) -> R
fn using_encoded<R, F>(&self, f: F) -> R
source§fn encoded_size(&self) -> usize
fn encoded_size(&self) -> usize
source§impl<A, B> From<(A, B)> for MultiAsset
impl<A, B> From<(A, B)> for MultiAsset
source§fn from(_: (A, B)) -> MultiAsset
fn from(_: (A, B)) -> MultiAsset
source§impl From<MultiAsset> for Assets
impl From<MultiAsset> for Assets
source§fn from(asset: MultiAsset) -> Assets
fn from(asset: MultiAsset) -> Assets
source§impl From<MultiAsset> for MultiAssetFilter
impl From<MultiAsset> for MultiAssetFilter
source§fn from(x: MultiAsset) -> MultiAssetFilter
fn from(x: MultiAsset) -> MultiAssetFilter
source§impl MaxEncodedLen for MultiAsset
impl MaxEncodedLen for MultiAsset
source§fn max_encoded_len() -> usize
fn max_encoded_len() -> usize
source§impl Ord for MultiAsset
impl Ord for MultiAsset
source§fn cmp(&self, other: &MultiAsset) -> Ordering
fn cmp(&self, other: &MultiAsset) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
source§impl PartialEq for MultiAsset
impl PartialEq for MultiAsset
source§fn eq(&self, other: &MultiAsset) -> bool
fn eq(&self, other: &MultiAsset) -> bool
self and other values to be equal, and is used
by ==.source§impl PartialOrd for MultiAsset
impl PartialOrd for MultiAsset
source§fn partial_cmp(&self, other: &MultiAsset) -> Option<Ordering>
fn partial_cmp(&self, other: &MultiAsset) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self and other) and is used by the <=
operator. Read moresource§impl Serialize for MultiAsset
impl Serialize for MultiAsset
source§fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
source§impl TryFrom<MultiAsset> for MultiAsset
impl TryFrom<MultiAsset> for MultiAsset
source§fn try_from(old: MultiAsset) -> Result<MultiAsset, ()>
fn try_from(old: MultiAsset) -> Result<MultiAsset, ()>
source§impl TryFrom<VersionedMultiAsset> for MultiAsset
impl TryFrom<VersionedMultiAsset> for MultiAsset
source§fn try_from(x: VersionedMultiAsset) -> Result<MultiAsset, ()>
fn try_from(x: VersionedMultiAsset) -> Result<MultiAsset, ()>
source§impl TypeInfo for MultiAsset
impl TypeInfo for MultiAsset
impl EncodeLike for MultiAsset
impl Eq for MultiAsset
impl StructuralEq for MultiAsset
impl StructuralPartialEq for MultiAsset
Auto Trait Implementations§
impl RefUnwindSafe for MultiAsset
impl Send for MultiAsset
impl Sync for MultiAsset
impl Unpin for MultiAsset
impl UnwindSafe for MultiAsset
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> CheckedConversion for T
impl<T> CheckedConversion for T
source§impl<T> DecodeLimit for Twhere
T: Decode,
impl<T> DecodeLimit for Twhere
T: Decode,
source§impl<T> DefensiveMax<T> for Twhere
T: PartialOrd,
impl<T> DefensiveMax<T> for Twhere
T: PartialOrd,
source§fn defensive_max(self, other: T) -> T
fn defensive_max(self, other: T) -> T
source§fn defensive_strict_max(self, other: T) -> T
fn defensive_strict_max(self, other: T) -> T
source§impl<T> DefensiveMin<T> for Twhere
T: PartialOrd,
impl<T> DefensiveMin<T> for Twhere
T: PartialOrd,
source§fn defensive_min(self, other: T) -> T
fn defensive_min(self, other: T) -> T
source§fn defensive_strict_min(self, other: T) -> T
fn defensive_strict_min(self, other: T) -> T
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.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
§impl<T, Outer> IsWrappedBy<Outer> for T
impl<T, Outer> IsWrappedBy<Outer> for T
source§impl<T> SaturatedConversion for T
impl<T> SaturatedConversion for T
source§fn saturated_from<T>(t: T) -> Selfwhere
Self: UniqueSaturatedFrom<T>,
fn saturated_from<T>(t: T) -> Selfwhere
Self: UniqueSaturatedFrom<T>,
source§fn saturated_into<T>(self) -> Twhere
Self: UniqueSaturatedInto<T>,
fn saturated_into<T>(self) -> Twhere
Self: UniqueSaturatedInto<T>,
T. Read more§impl<S, T> UncheckedInto<T> for Swhere
T: UncheckedFrom<S>,
impl<S, T> UncheckedInto<T> for Swhere
T: UncheckedFrom<S>,
§fn unchecked_into(self) -> T
fn unchecked_into(self) -> T
unchecked_from.source§impl<T, S> UniqueSaturatedInto<T> for S
impl<T, S> UniqueSaturatedInto<T> for S
source§fn unique_saturated_into(self) -> T
fn unique_saturated_into(self) -> T
T.