pub trait NativeConvertible {
    type Native;

    // Required method
    fn to_native(&self) -> Self::Native;
}
Expand description

Provides a bridge from a complex smart contract type, managed by the MultiversX virtual machine, to a common Rust type.

This trait facilitates the conversion from managed types to native Rust types. The conversion is one-way and is designed to map multiple managed types to a single Rust type, establishing a many-to-one relationship.

Implementing this trait requires specifying the associated Native type and providing an implementation for the to_native method, which will carry out the actual conversion.

Type Parameters

  • Native: The native Rust type to which the managed type will be converted.

Methods

  • to_native: Performs the conversion from the managed type to the specified native Rust type.

Required Associated Types§

source

type Native

The native Rust type to which the managed type will be converted.

Required Methods§

source

fn to_native(&self) -> Self::Native

Converts the managed type to the specified native Rust type.

Implementations on Foreign Types§

source§

impl NativeConvertible for bool

§

type Native = bool

source§

fn to_native(&self) -> Self::Native

source§

impl NativeConvertible for i8

§

type Native = i8

source§

fn to_native(&self) -> Self::Native

source§

impl NativeConvertible for i16

§

type Native = i16

source§

fn to_native(&self) -> Self::Native

source§

impl NativeConvertible for i32

§

type Native = i32

source§

fn to_native(&self) -> Self::Native

source§

impl NativeConvertible for i64

§

type Native = i64

source§

fn to_native(&self) -> Self::Native

source§

impl NativeConvertible for u8

§

type Native = u8

source§

fn to_native(&self) -> Self::Native

source§

impl NativeConvertible for u16

§

type Native = u16

source§

fn to_native(&self) -> Self::Native

source§

impl NativeConvertible for u32

§

type Native = u32

source§

fn to_native(&self) -> Self::Native

source§

impl NativeConvertible for u64

§

type Native = u64

source§

fn to_native(&self) -> Self::Native

source§

impl NativeConvertible for ()

§

type Native = ()

source§

fn to_native(&self) -> Self::Native

source§

impl NativeConvertible for String

§

type Native = String

source§

fn to_native(&self) -> Self::Native

source§

impl NativeConvertible for Empty

§

type Native = Empty

source§

fn to_native(&self) -> Self::Native

source§

impl NativeConvertible for IgnoreValue

§

type Native = ()

source§

fn to_native(&self) -> Self::Native

source§

impl NativeConvertible for CodeMetadata

§

type Native = u16

source§

fn to_native(&self) -> Self::Native

source§

impl<M: ManagedTypeApi> NativeConvertible for BigInt<M>

§

type Native = BigInt

source§

fn to_native(&self) -> Self::Native

source§

impl<M: ManagedTypeApi> NativeConvertible for BigUint<M>

§

type Native = BigUint

source§

fn to_native(&self) -> Self::Native

source§

impl<M: ManagedTypeApi> NativeConvertible for ManagedBuffer<M>

§

type Native = String

source§

fn to_native(&self) -> Self::Native

source§

impl<M: ManagedTypeApi> NativeConvertible for EgldOrEsdtTokenIdentifier<M>

§

type Native = String

source§

fn to_native(&self) -> Self::Native

source§

impl<M: ManagedTypeApi> NativeConvertible for EsdtTokenPayment<M>

§

type Native = Payment

source§

fn to_native(&self) -> Self::Native

source§

impl<M: ManagedTypeApi> NativeConvertible for ManagedAddress<M>

§

type Native = Address

source§

fn to_native(&self) -> Self::Native

source§

impl<M: ManagedTypeApi> NativeConvertible for TokenIdentifier<M>

§

type Native = String

source§

fn to_native(&self) -> Self::Native

source§

impl<M: ManagedTypeApi, T: NativeConvertible + TopDecodeMulti + Clone> NativeConvertible for MultiValueEncoded<M, T>

§

type Native = Vec<<T as NativeConvertible>::Native>

source§

fn to_native(&self) -> Self::Native

source§

impl<M: ManagedTypeApi, T: NativeConvertible + ManagedVecItem> NativeConvertible for ManagedVec<M, T>

§

type Native = Vec<<T as NativeConvertible>::Native>

source§

fn to_native(&self) -> Self::Native

source§

impl<T0> NativeConvertible for (T0,)

§

type Native = (<T0 as NativeConvertible>::Native,)

source§

fn to_native(&self) -> Self::Native

source§

impl<T0, T1> NativeConvertible for (T0, T1)

§

type Native = (<T0 as NativeConvertible>::Native, <T1 as NativeConvertible>::Native)

source§

fn to_native(&self) -> Self::Native

source§

impl<T0, T1, T2> NativeConvertible for (T0, T1, T2)

source§

impl<T0, T1, T2, T3> NativeConvertible for (T0, T1, T2, T3)

source§

impl<T0, T1, T2, T3, T4> NativeConvertible for (T0, T1, T2, T3, T4)

source§

impl<T0, T1, T2, T3, T4, T5> NativeConvertible for (T0, T1, T2, T3, T4, T5)

source§

impl<T0, T1, T2, T3, T4, T5, T6> NativeConvertible for (T0, T1, T2, T3, T4, T5, T6)

source§

impl<T0, T1, T2, T3, T4, T5, T6, T7> NativeConvertible for (T0, T1, T2, T3, T4, T5, T6, T7)

source§

impl<T0, T1, T2, T3, T4, T5, T6, T7, T8> NativeConvertible for (T0, T1, T2, T3, T4, T5, T6, T7, T8)

source§

impl<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9> NativeConvertible for (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9)

source§

impl<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> NativeConvertible for (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10)

source§

impl<T0: NativeConvertible, T1: NativeConvertible> NativeConvertible for MultiValue2<T0, T1>

§

type Native = (<T0 as NativeConvertible>::Native, <T1 as NativeConvertible>::Native)

source§

fn to_native(&self) -> Self::Native

source§

impl<T0: NativeConvertible, T1: NativeConvertible, T2: NativeConvertible> NativeConvertible for MultiValue3<T0, T1, T2>

source§

impl<T0: NativeConvertible, T1: NativeConvertible, T2: NativeConvertible, T3: NativeConvertible> NativeConvertible for MultiValue4<T0, T1, T2, T3>

source§

impl<T0: NativeConvertible, T1: NativeConvertible, T2: NativeConvertible, T3: NativeConvertible, T4: NativeConvertible> NativeConvertible for MultiValue5<T0, T1, T2, T3, T4>

source§

impl<T0: NativeConvertible, T1: NativeConvertible, T2: NativeConvertible, T3: NativeConvertible, T4: NativeConvertible, T5: NativeConvertible> NativeConvertible for MultiValue6<T0, T1, T2, T3, T4, T5>

source§

impl<T0: NativeConvertible, T1: NativeConvertible, T2: NativeConvertible, T3: NativeConvertible, T4: NativeConvertible, T5: NativeConvertible, T6: NativeConvertible> NativeConvertible for MultiValue7<T0, T1, T2, T3, T4, T5, T6>

source§

impl<T0: NativeConvertible, T1: NativeConvertible, T2: NativeConvertible, T3: NativeConvertible, T4: NativeConvertible, T5: NativeConvertible, T6: NativeConvertible, T7: NativeConvertible> NativeConvertible for MultiValue8<T0, T1, T2, T3, T4, T5, T6, T7>

source§

impl<T0: NativeConvertible, T1: NativeConvertible, T2: NativeConvertible, T3: NativeConvertible, T4: NativeConvertible, T5: NativeConvertible, T6: NativeConvertible, T7: NativeConvertible, T8: NativeConvertible> NativeConvertible for MultiValue9<T0, T1, T2, T3, T4, T5, T6, T7, T8>

source§

impl<T0: NativeConvertible, T1: NativeConvertible, T2: NativeConvertible, T3: NativeConvertible, T4: NativeConvertible, T5: NativeConvertible, T6: NativeConvertible, T7: NativeConvertible, T8: NativeConvertible, T9: NativeConvertible> NativeConvertible for MultiValue10<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9>

source§

impl<T0: NativeConvertible, T1: NativeConvertible, T2: NativeConvertible, T3: NativeConvertible, T4: NativeConvertible, T5: NativeConvertible, T6: NativeConvertible, T7: NativeConvertible, T8: NativeConvertible, T9: NativeConvertible, T10: NativeConvertible> NativeConvertible for MultiValue11<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>

source§

impl<T> NativeConvertible for MultiValueVec<T>

§

type Native = Vec<<T as NativeConvertible>::Native>

source§

fn to_native(&self) -> Self::Native

source§

impl<T: Clone + NativeConvertible> NativeConvertible for Option<T>

source§

impl<T: Clone + NativeConvertible> NativeConvertible for OptionalValue<T>

source§

impl<const N: usize> NativeConvertible for [u8; N]

§

type Native = Vec<u8>

source§

fn to_native(&self) -> Self::Native

Implementors§