multiversx_sc_scenario::imports

Trait NestedEncode

Source
pub trait NestedEncode: Sized {
    // Provided methods
    fn dep_encode<O>(&self, dest: &mut O) -> Result<(), EncodeError>
       where O: NestedEncodeOutput { ... }
    fn dep_encode_or_handle_err<O, H>(
        &self,
        dest: &mut O,
        h: H,
    ) -> Result<(), <H as EncodeErrorHandler>::HandledErr>
       where O: NestedEncodeOutput,
             H: EncodeErrorHandler { ... }
}
Expand description

Trait that allows zero-copy write of value-references to slices in LE format.

Implementations should override using_top_encoded for value types and dep_encode and size_hint for allocating types. Wrapper types should override all methods.

Provided Methods§

Source

fn dep_encode<O>(&self, dest: &mut O) -> Result<(), EncodeError>

NestedEncode to output, using the format of an object nested inside another structure. Does not provide compact version.

Source

fn dep_encode_or_handle_err<O, H>( &self, dest: &mut O, h: H, ) -> Result<(), <H as EncodeErrorHandler>::HandledErr>

Version of dep_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 NestedEncode for &str

Source§

impl NestedEncode for bool

Source§

impl NestedEncode for i8

Source§

impl NestedEncode for i16

Source§

impl NestedEncode for i32

Source§

impl NestedEncode for i64

Source§

impl NestedEncode for isize

Source§

impl NestedEncode for u8

Source§

impl NestedEncode for u16

Source§

impl NestedEncode for u32

Source§

impl NestedEncode for u64

Source§

impl NestedEncode for ()

Source§

impl NestedEncode for usize

Source§

impl NestedEncode for NonZero<usize>

Source§

impl NestedEncode for HeapAddress

Source§

impl NestedEncode for HeapH256

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

impl<T> NestedEncode for PhantomData<T>

Source§

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

Implementors§

Source§

impl NestedEncode for EsdtLocalRole

Source§

impl NestedEncode for EsdtTokenType

Source§

impl NestedEncode for MessageHashType

Source§

impl NestedEncode for Sign

Source§

impl NestedEncode for Address

Source§

impl NestedEncode for Bech32Address

Source§

impl NestedEncode for Box<str>

Source§

impl NestedEncode for BoxedBytes

Source§

impl NestedEncode for CodeMetadata

Source§

impl NestedEncode for Empty

Source§

impl NestedEncode for H256

Source§

impl NestedEncode for multiversx_sc_scenario::imports::RustBigInt

Source§

impl NestedEncode for multiversx_sc_scenario::imports::RustBigUint

Source§

impl NestedEncode for String

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

impl<M> NestedEncode for ManagedBufferReadToEnd<M>
where M: ManagedTypeApi,

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

impl<T> NestedEncode for LinkedListNode<T>

Source§

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

Serializes identically to a Vec, entries before start index are ignored.

Source§

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

Source§

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