1use core::fmt;
2
3#[derive(Copy, Clone, Debug)]
5pub struct IntoArrayError;
6
7impl fmt::Display for IntoArrayError {
8 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> Result<(), fmt::Error> {
9 f.write_str("Failed to convert into array.")
10 }
11}
12
13impl core::error::Error for IntoArrayError {}
14
15#[derive(Copy, Clone, Debug)]
18pub struct NotEqualError;
19
20impl fmt::Display for NotEqualError {
21 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> Result<(), fmt::Error> {
22 f.write_str("Length of input slices is not equal to each other")
23 }
24}
25
26impl core::error::Error for NotEqualError {}
27
28#[cfg(feature = "block-padding")]
30#[derive(Clone, Copy, Debug)]
31pub struct PadError;
32
33#[cfg(feature = "block-padding")]
34impl fmt::Display for PadError {
35 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> Result<(), fmt::Error> {
36 f.write_str("Padding error")
37 }
38}
39
40#[cfg(feature = "block-padding")]
41impl core::error::Error for PadError {}
42
43#[derive(Clone, Copy, Debug)]
45pub struct OutIsTooSmallError;
46
47impl fmt::Display for OutIsTooSmallError {
48 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> Result<(), fmt::Error> {
49 f.write_str("Output buffer is smaller than input")
50 }
51}
52
53impl core::error::Error for OutIsTooSmallError {}