pub enum DecodeError {
SuddenEnd {
actual_length: usize,
expected_length: usize,
},
TypeEndsTooEarly {
remaining_no_of_bytes: isize,
},
InvalidBoolean {
found_integer: i32,
at_position: usize,
},
VarOpaqueExceedsMaxLength {
at_position: usize,
max_length: i32,
actual_length: i32,
},
StringExceedsMaxLength {
at_position: usize,
max_length: i32,
actual_length: i32,
},
VarArrayExceedsMaxLength {
at_position: usize,
max_length: i32,
actual_length: i32,
},
InvalidOptional {
at_position: usize,
has_code: u32,
},
InvalidEnumDiscriminator {
at_position: usize,
},
InvalidBase64,
}Expand description
An error type for decoding XDR data
Variants§
SuddenEnd
The XDR data ends too early.
The decoder expects more bytes to decode the data successfully
The actual length and the expected length are given by actual_length and
expected_length
TypeEndsTooEarly
There binary data is longer than expected
The XDR is self delimiting and would end earlier than the length of the provided
binary data. The number of remaining bytes is given by remaining_no_of_bytes
InvalidBoolean
The XDR contains an invalid boolean
The boolean is neither encoded as 0 or 1. The value found is given by found_integer.
VarOpaqueExceedsMaxLength
The XDR contains a “Var Opaque” whose length exceeds the specified maximal length
StringExceedsMaxLength
The XDR contains a string whose length exceeds the specified maximal length
VarArrayExceedsMaxLength
The XDR contains a “Var Array” whose length exceeds the specified maximal length
InvalidOptional
The XDR contains an in invalid “Optional”
The “optional” is neither encoded as 0 or 1. The value found is given by has_code.
InvalidEnumDiscriminator
The XDR contains an enum with an invalid discriminator
The discriminator does not have one of the allowed values
InvalidBase64
The base64 encoding of the binary XDR is invalid