multiversx_sc_codec

Trait NestedEncode

Source
pub trait NestedEncode: Sized {
    // Provided methods
    fn dep_encode<O: NestedEncodeOutput>(
        &self,
        dest: &mut O,
    ) -> Result<(), EncodeError> { ... }
    fn dep_encode_or_handle_err<O, H>(
        &self,
        dest: &mut O,
        h: H,
    ) -> Result<(), H::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: NestedEncodeOutput>( &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::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 Box<str>

Source§

impl NestedEncode for String

Source§

impl NestedEncode for NonZeroUsize

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 PhantomData<T>

Source§

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

Source§

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

Source§

impl<T: NestedEncode> NestedEncode for &T

Source§

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

Source§

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

Source§

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

Source§

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

Implementors§