novax_data

Trait NativeConvertible

source
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

source§

type Native = bool

source§

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

source§

impl NativeConvertible for i8

source§

type Native = i8

source§

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

source§

impl NativeConvertible for i16

source§

type Native = i16

source§

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

source§

impl NativeConvertible for i32

source§

type Native = i32

source§

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

source§

impl NativeConvertible for i64

source§

type Native = i64

source§

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

source§

impl NativeConvertible for u8

source§

type Native = u8

source§

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

source§

impl NativeConvertible for u16

source§

type Native = u16

source§

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

source§

impl NativeConvertible for u32

source§

type Native = u32

source§

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

source§

impl NativeConvertible for u64

source§

type Native = u64

source§

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

source§

impl NativeConvertible for ()

source§

type Native = ()

source§

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

source§

impl NativeConvertible for String

source§

impl NativeConvertible for Empty

source§

type Native = Empty

source§

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

source§

impl NativeConvertible for IgnoreValue

source§

type Native = ()

source§

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

source§

impl NativeConvertible for CodeMetadata

source§

type Native = u16

source§

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

source§

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

source§

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

source§

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

source§

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

source§

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

source§

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

source§

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

source§

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

source§

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

source§

impl<T0> NativeConvertible for (T0,)

source§

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

source§

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

source§

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

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>

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>

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]

source§

type Native = Vec<u8>

source§

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

Implementors§