multiversx_sc_codec

Trait TopDecodeMultiInput

Source
pub trait TopDecodeMultiInput: Sized {
    type ValueInput: TopDecodeInput;

    // Required methods
    fn has_next(&self) -> bool;
    fn next_value_input<H>(
        &mut self,
        h: H,
    ) -> Result<Self::ValueInput, H::HandledErr>
       where H: DecodeErrorHandler;

    // Provided methods
    fn next_value<T, H>(&mut self, h: H) -> Result<T, H::HandledErr>
       where T: TopDecode,
             H: DecodeErrorHandler { ... }
    fn assert_no_more_args<H>(&self, h: H) -> Result<(), H::HandledErr>
       where H: DecodeErrorHandler { ... }
    fn flush_ignore<H>(&mut self, h: H) -> Result<(), H::HandledErr>
       where H: DecodeErrorHandler { ... }
}

Required Associated Types§

Required Methods§

Source

fn has_next(&self) -> bool

Check if there are more arguments that can be loaded.

Source

fn next_value_input<H>( &mut self, h: H, ) -> Result<Self::ValueInput, H::HandledErr>

Retrieves an input for deserializing an argument. If the loader is out of arguments, it will crash by itself with an appropriate error, without returning. Use if the next argument is optional, use has_next beforehand.

Provided Methods§

Source

fn next_value<T, H>(&mut self, h: H) -> Result<T, H::HandledErr>

Source

fn assert_no_more_args<H>(&self, h: H) -> Result<(), H::HandledErr>

Called after retrieving all arguments to validate that extra arguments were not provided.

Source

fn flush_ignore<H>(&mut self, h: H) -> Result<(), H::HandledErr>

Consumes all inputs and ignores them. After executing this, assert_no_more_args should not fail.

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.

Implementors§