Skip to main content

aeron_rpc/
err.rs

1#[derive(Debug)]
2pub enum SendError {
3    Timeout,
4    SendFailed(String),
5    ParseError(String),
6    Custom(String),
7}
8
9#[derive(Debug)]
10pub enum ReceiveError {
11    ParseError(String),
12    Timeout,
13    Custom(String),
14}
15
16#[derive(Debug)]
17pub enum FromBytesError {
18    ParseError(String),
19    Custom(String),
20}
21
22impl From<FromBytesError> for SendError {
23    fn from(err: FromBytesError) -> Self {
24        match err {
25            FromBytesError::ParseError(e) => SendError::ParseError(e),
26            FromBytesError::Custom(e) => SendError::Custom(e),
27        }
28    }
29}
30
31impl From<FromBytesError> for ReceiveError {
32    fn from(err: FromBytesError) -> Self {
33        match err {
34            FromBytesError::ParseError(e) => ReceiveError::ParseError(e),
35            FromBytesError::Custom(e) => ReceiveError::Custom(e),
36        }
37    }
38}