1use core::fmt;
4
5#[derive(Copy, Clone, Debug)]
12pub struct StreamCipherError;
13
14impl fmt::Display for StreamCipherError {
15 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> Result<(), fmt::Error> {
16 f.write_str("Loop Error")
17 }
18}
19
20#[cfg(feature = "std")]
21#[cfg_attr(docsrs, doc(cfg(feature = "std")))]
22impl std::error::Error for StreamCipherError {}
23
24#[derive(Copy, Clone, Debug)]
27pub struct OverflowError;
28
29impl fmt::Display for OverflowError {
30 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> Result<(), fmt::Error> {
31 f.write_str("Overflow Error")
32 }
33}
34
35impl From<OverflowError> for StreamCipherError {
36 fn from(_: OverflowError) -> StreamCipherError {
37 StreamCipherError
38 }
39}
40
41#[cfg(feature = "std")]
42#[cfg_attr(docsrs, doc(cfg(feature = "std")))]
43impl std::error::Error for OverflowError {}