multiversx_sc_scenario::imports

Trait TopEncode

Source
pub trait TopEncode: Sized {
    // Provided methods
    fn top_encode<O>(&self, output: O) -> Result<(), EncodeError>
       where O: TopEncodeOutput { ... }
    fn top_encode_or_handle_err<O, H>(
        &self,
        output: O,
        h: H,
    ) -> Result<(), <H as EncodeErrorHandler>::HandledErr>
       where O: TopEncodeOutput,
             H: EncodeErrorHandler { ... }
}

Provided Methods§

Source

fn top_encode<O>(&self, output: O) -> Result<(), EncodeError>
where O: TopEncodeOutput,

Attempt to serialize the value to ouput.

Source

fn top_encode_or_handle_err<O, H>( &self, output: O, h: H, ) -> Result<(), <H as EncodeErrorHandler>::HandledErr>

Version of top_encode that can handle errors as soon as they occur. For instance in can exit immediately and make sure that if it returns, it is a success. By not deferring error handling, this can lead to somewhat smaller bytecode.

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.

Implementations on Foreign Types§

Source§

impl TopEncode for &str

Source§

fn top_encode_or_handle_err<O, H>( &self, output: O, _h: H, ) -> Result<(), <H as EncodeErrorHandler>::HandledErr>

Source§

impl TopEncode for bool

Source§

fn top_encode_or_handle_err<O, H>( &self, output: O, _h: H, ) -> Result<(), <H as EncodeErrorHandler>::HandledErr>

Source§

impl TopEncode for i8

Source§

fn top_encode_or_handle_err<O, H>( &self, output: O, _h: H, ) -> Result<(), <H as EncodeErrorHandler>::HandledErr>

Source§

impl TopEncode for i16

Source§

fn top_encode_or_handle_err<O, H>( &self, output: O, _h: H, ) -> Result<(), <H as EncodeErrorHandler>::HandledErr>

Source§

impl TopEncode for i32

Source§

fn top_encode_or_handle_err<O, H>( &self, output: O, _h: H, ) -> Result<(), <H as EncodeErrorHandler>::HandledErr>

Source§

impl TopEncode for i64

Source§

fn top_encode_or_handle_err<O, H>( &self, output: O, _h: H, ) -> Result<(), <H as EncodeErrorHandler>::HandledErr>

Source§

impl TopEncode for isize

Source§

fn top_encode_or_handle_err<O, H>( &self, output: O, _h: H, ) -> Result<(), <H as EncodeErrorHandler>::HandledErr>

Source§

impl TopEncode for u8

Source§

fn top_encode_or_handle_err<O, H>( &self, output: O, _h: H, ) -> Result<(), <H as EncodeErrorHandler>::HandledErr>

Source§

impl TopEncode for u16

Source§

fn top_encode_or_handle_err<O, H>( &self, output: O, _h: H, ) -> Result<(), <H as EncodeErrorHandler>::HandledErr>

Source§

impl TopEncode for u32

Source§

fn top_encode_or_handle_err<O, H>( &self, output: O, _h: H, ) -> Result<(), <H as EncodeErrorHandler>::HandledErr>

Source§

impl TopEncode for u64

Source§

fn top_encode_or_handle_err<O, H>( &self, output: O, _h: H, ) -> Result<(), <H as EncodeErrorHandler>::HandledErr>

Source§

impl TopEncode for usize

Source§

fn top_encode_or_handle_err<O, H>( &self, output: O, _h: H, ) -> Result<(), <H as EncodeErrorHandler>::HandledErr>

Source§

impl TopEncode for NonZero<usize>

Source§

fn top_encode_or_handle_err<O, H>( &self, output: O, h: H, ) -> Result<(), <H as EncodeErrorHandler>::HandledErr>

Source§

impl TopEncode for HeapAddress

Source§

fn top_encode_or_handle_err<O, H>( &self, output: O, h: H, ) -> Result<(), <H as EncodeErrorHandler>::HandledErr>

Source§

impl TopEncode for HeapH256

Source§

fn top_encode_or_handle_err<O, H>( &self, output: O, _h: H, ) -> Result<(), <H as EncodeErrorHandler>::HandledErr>

Source§

impl<T0> TopEncode for (T0,)
where T0: NestedEncode,

Source§

fn top_encode_or_handle_err<O, H>( &self, output: O, h: H, ) -> Result<(), <H as EncodeErrorHandler>::HandledErr>

Source§

impl<T0, T1> TopEncode for (T0, T1)
where T0: NestedEncode, T1: NestedEncode,

Source§

fn top_encode_or_handle_err<O, H>( &self, output: O, h: H, ) -> Result<(), <H as EncodeErrorHandler>::HandledErr>

Source§

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

Source§

fn top_encode_or_handle_err<O, H>( &self, output: O, h: H, ) -> Result<(), <H as EncodeErrorHandler>::HandledErr>

Source§

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

Source§

fn top_encode_or_handle_err<O, H>( &self, output: O, h: H, ) -> Result<(), <H as EncodeErrorHandler>::HandledErr>

Source§

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

Source§

fn top_encode_or_handle_err<O, H>( &self, output: O, h: H, ) -> Result<(), <H as EncodeErrorHandler>::HandledErr>

Source§

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

Source§

fn top_encode_or_handle_err<O, H>( &self, output: O, h: H, ) -> Result<(), <H as EncodeErrorHandler>::HandledErr>

Source§

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

Source§

fn top_encode_or_handle_err<O, H>( &self, output: O, h: H, ) -> Result<(), <H as EncodeErrorHandler>::HandledErr>

Source§

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

Source§

fn top_encode_or_handle_err<O, H>( &self, output: O, h: H, ) -> Result<(), <H as EncodeErrorHandler>::HandledErr>

Source§

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

Source§

fn top_encode_or_handle_err<O, H>( &self, output: O, h: H, ) -> Result<(), <H as EncodeErrorHandler>::HandledErr>

Source§

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

Source§

fn top_encode_or_handle_err<O, H>( &self, output: O, h: H, ) -> Result<(), <H as EncodeErrorHandler>::HandledErr>

Source§

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

Source§

fn top_encode_or_handle_err<O, H>( &self, output: O, h: H, ) -> Result<(), <H as EncodeErrorHandler>::HandledErr>

Source§

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

Source§

fn top_encode_or_handle_err<O, H>( &self, output: O, h: H, ) -> Result<(), <H as EncodeErrorHandler>::HandledErr>

Source§

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

Source§

fn top_encode_or_handle_err<O, H>( &self, output: O, h: H, ) -> Result<(), <H as EncodeErrorHandler>::HandledErr>

Source§

impl<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13> TopEncode for (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13)

Source§

fn top_encode_or_handle_err<O, H>( &self, output: O, h: H, ) -> Result<(), <H as EncodeErrorHandler>::HandledErr>

Source§

impl<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14> TopEncode for (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14)

Source§

fn top_encode_or_handle_err<O, H>( &self, output: O, h: H, ) -> Result<(), <H as EncodeErrorHandler>::HandledErr>

Source§

impl<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15> TopEncode for (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15)

Source§

fn top_encode_or_handle_err<O, H>( &self, output: O, h: H, ) -> Result<(), <H as EncodeErrorHandler>::HandledErr>

Source§

impl<T> TopEncode for &[T]
where T: NestedEncode,

Source§

fn top_encode_or_handle_err<O, H>( &self, output: O, h: H, ) -> Result<(), <H as EncodeErrorHandler>::HandledErr>

Source§

impl<T> TopEncode for Option<T>
where T: NestedEncode,

Source§

fn top_encode_or_handle_err<O, H>( &self, output: O, h: H, ) -> Result<(), <H as EncodeErrorHandler>::HandledErr>

Allow None to be serialized to empty bytes, but leave the leading “1” for Some, to allow disambiguation between e.g. Some(0) and None.

Source§

impl<T> TopEncode for &T
where T: TopEncode,

Source§

fn top_encode_or_handle_err<O, H>( &self, output: O, h: H, ) -> Result<(), <H as EncodeErrorHandler>::HandledErr>

Source§

impl<T> TopEncode for PhantomData<T>

Empty structure with an empty bytes representation. Equivalent to false, 0 or [u8; 0], but more explicit.

Note: the unit type () would have naturally fit this role, but we decided to make the unit type multi-value only.

Source§

fn top_encode_or_handle_err<O, H>( &self, output: O, _h: H, ) -> Result<(), <H as EncodeErrorHandler>::HandledErr>

Source§

impl<T, const N: usize> TopEncode for [T; N]
where T: NestedEncode,

Source§

fn top_encode_or_handle_err<O, H>( &self, output: O, h: H, ) -> Result<(), <H as EncodeErrorHandler>::HandledErr>

Implementors§

Source§

impl TopEncode for EsdtLocalRole

Source§

impl TopEncode for EsdtTokenType

Source§

impl TopEncode for MessageHashType

Source§

impl TopEncode for OperationCompletionStatus

Source§

impl TopEncode for Sign

Source§

impl TopEncode for Address

Source§

impl TopEncode for Bech32Address

Source§

impl TopEncode for Box<str>

Source§

impl TopEncode for BoxedBytes

Source§

impl TopEncode for CodeMetadata

Source§

impl TopEncode for ESDTSystemSCAddress

Source§

impl TopEncode for Empty

Source§

impl TopEncode for H256

Source§

impl TopEncode for multiversx_sc_scenario::imports::RustBigInt

Source§

impl TopEncode for multiversx_sc_scenario::imports::RustBigUint

Source§

impl TopEncode for String

Source§

impl TopEncode for TestAddress<'_>

Source§

impl TopEncode for TestSCAddress<'_>

Source§

impl TopEncode for TestTokenIdentifier<'_>

Source§

impl<E, const CAPACITY: usize> TopEncode for SparseArray<E, CAPACITY>
where E: ErrorApi,

Source§

impl<M> TopEncode for EgldOrMultiEsdtPayment<M>
where M: ManagedTypeApi,

Source§

impl<M> TopEncode for TokenMapperState<M>
where M: ManagedTypeApi,

Source§

impl<M> TopEncode for BigFloat<M>
where M: ManagedTypeApi,

Source§

impl<M> TopEncode for multiversx_sc_scenario::imports::BigInt<M>
where M: ManagedTypeApi,

Source§

impl<M> TopEncode for multiversx_sc_scenario::imports::BigUint<M>
where M: ManagedTypeApi,

Source§

impl<M> TopEncode for CallbackClosure<M>

Source§

impl<M> TopEncode for EgldOrEsdtTokenIdentifier<M>
where M: ManagedTypeApi,

Source§

impl<M> TopEncode for EgldOrEsdtTokenPayment<M>
where M: ManagedTypeApi,

Source§

impl<M> TopEncode for EllipticCurve<M>
where M: ManagedTypeApi,

Source§

impl<M> TopEncode for EsdtTokenData<M>
where M: ManagedTypeApi,

Source§

impl<M> TopEncode for EsdtTokenPayment<M>
where M: ManagedTypeApi,

Source§

impl<M> TopEncode for ManagedAddress<M>
where M: ManagedTypeApi,

Source§

impl<M> TopEncode for ManagedArgBuffer<M>
where M: ManagedTypeApi,

Source§

impl<M> TopEncode for ManagedBuffer<M>
where M: ManagedTypeApi,

Source§

impl<M> TopEncode for ManagedDecimal<M, usize>
where M: ManagedTypeApi,

Source§

impl<M> TopEncode for ManagedDecimalSigned<M, usize>
where M: ManagedTypeApi,

Source§

impl<M> TopEncode for TokenIdentifier<M>
where M: ManagedTypeApi,

Source§

impl<M, T> TopEncode for ManagedOption<M, T>

Source§

impl<M, T> TopEncode for ManagedRef<'_, M, T>

Source§

impl<M, T> TopEncode for ManagedRefMut<'_, M, T>

Source§

impl<M, T> TopEncode for ManagedVec<M, T>

Source§

impl<M, const DECIMALS: usize> TopEncode for ManagedDecimal<M, ConstDecimals<DECIMALS>>
where M: ManagedTypeApi,

Source§

impl<M, const DECIMALS: usize> TopEncode for ManagedDecimalSigned<M, ConstDecimals<DECIMALS>>
where M: ManagedTypeApi,

Source§

impl<M, const N: usize> TopEncode for ManagedByteArray<M, N>
where M: ManagedTypeApi,

Source§

impl<P: ProxyObjNew> TopEncode for ContractInfo<P>

Source§

impl<T> TopEncode for Box<[T]>
where T: NestedEncode,

Source§

impl<T> TopEncode for Box<T>
where T: TopEncode,

Source§

impl<T> TopEncode for LinkedListNode<T>

Source§

impl<T> TopEncode for OrderedBinaryTreeNode<T>

Source§

impl<T> TopEncode for Queue<T>
where T: NestedEncode,

Source§

impl<T> TopEncode for SingleValue<T>
where T: TopEncode + TopDecode,

Source§

impl<T> TopEncode for Vec<T>
where T: NestedEncode,

Source§

impl<T, const CAP: usize> TopEncode for ArrayVec<T, CAP>
where T: NestedEncode,