1use alloc::string::String;
2
3#[derive(snafu::Snafu, Debug)]
4#[snafu(visibility(pub))]
5#[snafu(display("Invalid BMP string, character decimal value: {}", character))]
6pub struct InvalidBmpString {
7 pub character: u16,
8}
9
10#[derive(snafu::Snafu, Debug)]
11#[snafu(visibility(pub))]
12#[snafu(display("Invalid general string, character decimal value: {}", character))]
13pub struct InvalidGeneralString {
14 pub character: u8,
15}
16
17#[derive(snafu::Snafu, Debug)]
18#[snafu(visibility(pub))]
19#[snafu(display("Invalid ISO 646/ASCII, character decimal value: {}", character))]
20pub struct InvalidIso646Character {
21 pub character: u8,
22}
23
24#[derive(snafu::Snafu, Debug)]
25#[snafu(visibility(pub))]
26#[snafu(display("Invalid numeric string, character decimal value: {}", character))]
27pub struct InvalidNumericString {
28 pub character: u8,
29}
30
31#[derive(snafu::Snafu, Debug)]
32#[snafu(visibility(pub))]
33#[snafu(display("Invalid printable string, character decimal value: {}", character))]
34pub struct InvalidPrintableString {
35 pub character: u32,
36}
37
38#[derive(Debug, snafu::Snafu)]
39#[snafu(visibility(pub))]
40pub enum PermittedAlphabetError {
41 #[snafu(display("error converting to string: {}", message))]
42 Other { message: String },
43 #[snafu(display(
44 "length of bits ({length}) provided not divisible by character width ({width})"
45 ))]
46 InvalidData { length: usize, width: usize },
47 #[snafu(display("index not found {}", 0))]
48 IndexNotFound { index: u32 },
49 #[snafu(display(
50 "Character with decimal value {} not found from the permitted list.",
51 character
52 ))]
53 CharacterNotFound { character: u32 },
54}