pub enum CodecError {
Truncated {
needed: usize,
remaining: usize,
},
BadMagic,
BadVersion(u32),
BadEnum {
ty: &'static str,
raw: i64,
},
BadBool(u8),
NonZeroReserved(u64),
LenOverflow {
len: usize,
max: usize,
},
TrailingBytes(usize),
InvalidUtf8,
DepthExceeded {
max: usize,
},
}Expand description
Typed, allocation-free error produced by ByteReader, ByteWriter, SliceWriter,
and #[derive(NvCodec)].
Variants§
Truncated
Input ended before the required number of bytes could be read (or destination slice was full).
BadMagic
Expected fixed magic prefix did not match.
BadVersion(u32)
Unsupported wire or archive format version.
BadEnum
Unknown enum discriminant or tag (stored as i64 so both u32::MAX and i32::MIN are exact).
BadBool(u8)
Boolean byte was neither 0 nor 1.
NonZeroReserved(u64)
Reserved / padding field was non-zero.
LenOverflow
Length or element count exceeded its configured upper bound or wire integer capacity.
TrailingBytes(usize)
Unexpected unread bytes remained at ByteReader::finish / SliceWriter::finish.
InvalidUtf8
Length-prefixed string slice was not valid UTF-8.
DepthExceeded
Recursive container nesting (read_vec/read_opt) exceeded ByteReader’s max depth.
Trait Implementations§
Source§impl Clone for CodecError
impl Clone for CodecError
Source§impl Debug for CodecError
impl Debug for CodecError
Source§impl Display for CodecError
impl Display for CodecError
impl Eq for CodecError
Source§impl Error for CodecError
impl Error for CodecError
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()