1use core::fmt;
2use std::error::Error;
3
4#[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord)]
6pub enum ParseError {
7 InvalidLength,
9}
10
11impl fmt::Display for ParseError {
12 fn fmt(&self, f: &mut fmt::Formatter) -> Result<(), fmt::Error> {
13 match self {
14 ParseError::InvalidLength => {
15 write!(f, "The input string length is too large to fit in a `u32`")
16 }
17 }
18 }
19}
20
21impl Error for ParseError {}
22
23#[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord)]
25pub enum SetBytesError {
26 LengthOverflow,
28}
29
30impl fmt::Display for SetBytesError {
31 fn fmt(&self, f: &mut fmt::Formatter) -> Result<(), fmt::Error> {
32 match self {
33 SetBytesError::LengthOverflow => {
34 write!(f, "The string length is too large to fit in a `u32`")
35 }
36 }
37 }
38}
39
40impl Error for SetBytesError {}