Trait gclient::ext::sp_runtime::codec::DecodeLimit
pub trait DecodeLimit: Sized {
// Required methods
fn decode_with_depth_limit<I>(
limit: u32,
input: &mut I,
) -> Result<Self, Error>
where I: Input;
fn decode_all_with_depth_limit(
limit: u32,
input: &mut &[u8],
) -> Result<Self, Error>;
}
Expand description
Extension trait to Decode
for decoding with a maximum recursion depth.
Required Methods§
fn decode_with_depth_limit<I>(limit: u32, input: &mut I) -> Result<Self, Error>where
I: Input,
fn decode_with_depth_limit<I>(limit: u32, input: &mut I) -> Result<Self, Error>where
I: Input,
Decode Self
with the given maximum recursion depth and advance input
by the number of
bytes consumed.
If limit
is hit, an error is returned.
fn decode_all_with_depth_limit(
limit: u32,
input: &mut &[u8],
) -> Result<Self, Error>
fn decode_all_with_depth_limit( limit: u32, input: &mut &[u8], ) -> Result<Self, Error>
Decode Self
and consume all of the given input data.
If not all data is consumed or limit
is hit, an error is returned.
Object Safety§
This trait is not object safe.