parity_scale_codec

Trait DecodeWithMemLimit

Source
pub trait DecodeWithMemLimit: DecodeWithMemTracking {
    // Required method
    fn decode_with_mem_limit<I: Input>(
        input: &mut I,
        mem_limit: usize,
    ) -> Result<Self, Error>;
}
Expand description

Extension trait to Decode for decoding with a maximum memory limit.

Required Methods§

Source

fn decode_with_mem_limit<I: Input>( input: &mut I, mem_limit: usize, ) -> Result<Self, Error>

Decode Self with the given maximum memory limit and advance input by the number of bytes consumed.

If mem_limit is hit, an error is returned.

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§