pub enum ReadError {
SourceEmpty {
requested: usize,
remaining: usize,
},
SourceRemaining {
remaining: u64,
},
InvalidHeaderByte {
h: u8,
},
IntegerOutOfRange,
BadBool,
BadDiscriminator(i32),
MaxLengthExceeded,
NonZeroPadding,
BadUTF8,
NotMinimalEncoding,
}Expand description
Errors that can occur when reading XDR data.
Variants§
SourceEmpty
The input ended before the requested number of bytes could be read.
Fields
SourceRemaining
Decoding completed but bytes remain unconsumed in the input.
InvalidHeaderByte
A CXS integer header byte used a reserved combination of its
size/value bit fields (see CXS.md).
IntegerOutOfRange
The decoded integer does not fit in the target integer type.
BadBool
A decoded boolean was neither 0 (FALSE) nor 1 (TRUE).
BadDiscriminator(i32)
A decoded union discriminant did not match any known variant.
MaxLengthExceeded
A decoded length exceeds the maximum declared for the variable-length array, opaque data, or string.
NonZeroPadding
A TXS padding byte was non-zero (rejected unless feature
permissive is enabled).
BadUTF8
A decoded string was not valid UTF-8.
NotMinimalEncoding
A CXS integer was not encoded in the minimal number of bytes
(rejected unless feature permissive is enabled).
Trait Implementations§
impl Copy for ReadError
Source§impl Error for ReadError
impl Error for ReadError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()