1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
use core::fmt::{Debug, Display, Formatter};
use serde_bolt::Error as BoltError;
#[derive(Debug, Clone)]
pub enum Error {
UnexpectedType(u16),
BadFraming,
BoltError(BoltError),
TrailingBytes(usize, u16),
ShortRead,
MessageTooLarge,
Eof,
}
impl From<BoltError> for Error {
fn from(e: BoltError) -> Self {
Error::BoltError(e)
}
}
pub type Result<T> = core::result::Result<T, Error>;
impl Display for Error {
fn fmt(&self, f: &mut Formatter<'_>) -> core::fmt::Result {
Debug::fmt(self, f)
}
}
#[cfg(feature = "std")]
impl std::error::Error for Error {}