referrerpolicy=no-referrer-when-downgrade

Trait DerivativesRegistry

Source
pub trait DerivativesRegistry<Original, Derivative> {
    // Required methods
    fn try_register_derivative(
        original: &Original,
        derivative: &Derivative,
    ) -> DispatchResult;
    fn try_deregister_derivative_of(original: &Original) -> DispatchResult;
    fn get_derivative(original: &Original) -> Result<Derivative, DispatchError>;
    fn get_original(derivative: &Derivative) -> Result<Original, DispatchError>;
}
Expand description

A registry abstracts the mapping between an Original entity and a Derivative entity.

The primary use cases of the registry are:

  • a map between an AssetId and an chain-local asset ID. For instance, it could be chain-local currency ID or an NFT collection ID.
  • a map between a [NonFungibleAsset] and a derivative instance ID to create a new derivative instance

Required Methods§

Source

fn try_register_derivative( original: &Original, derivative: &Derivative, ) -> DispatchResult

Source

fn try_deregister_derivative_of(original: &Original) -> DispatchResult

Source

fn get_derivative(original: &Original) -> Result<Derivative, DispatchError>

Source

fn get_original(derivative: &Derivative) -> Result<Original, DispatchError>

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.

Implementors§

Source§

impl<T: Config<I>, I: 'static> DerivativesRegistry<<T as Config<I>>::Original, <T as Config<I>>::Derivative> for Pallet<T, I>