pub trait MatchesInstance<Id> {
// Required method
fn matches_instance(a: &Asset) -> Result<Id, Error>;
}
Expand description
Unique instances matcher trait.
The Id
type should be defined in such a way so that its value can unambigiously identify an
instance. I.e., if instances are grouped (e.g., as tokens in an NFT collection), the Id
should
contain both the group ID and the item group-local ID.
This unified interface allows us to avoid duplicating the XCM adapters for non-grouped and grouped instances.
NOTE: The trait implementors should follow the convention of identifying the collection-less
NFTs by an XCM Asset
of the form { asset_id: NFT_ID, fun: Fungibility::NonFungible(AssetInstance::Undefined) }
.
Required Methods§
fn matches_instance(a: &Asset) -> Result<Id, Error>
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.