encdec_base/
error.rs

1//! Basic encdec [`Error`] type
2
3use core::convert::Infallible;
4
5/// Basic encode/decode error type
6#[derive(Copy, Clone, PartialEq, Eq, Debug)]
7#[cfg_attr(feature = "thiserror", derive(thiserror::Error))]
8pub enum Error {
9    /// Buffer length error in encode or decode
10    Length,
11    /// Invalid UTF8 in string
12    Utf8,
13    /// Invalid enum variant
14    Variant,
15}
16
17impl From<Infallible> for Error {
18    fn from(_: Infallible) -> Self {
19        unreachable!()
20    }
21}