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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
use std::net::AddrParseError;
/// Error type returned by rs-netty operations.
#[derive(Debug, thiserror::Error)]
pub enum Error {
/// Underlying I/O error.
#[error("io error: {0}")]
Io(#[from] std::io::Error),
/// Socket address parsing failed.
#[error("address parse error: {0}")]
AddrParse(#[from] AddrParseError),
/// Tokio task join failed.
#[error("task join error: {0}")]
Join(#[from] tokio::task::JoinError),
/// Connection or socket is closed.
#[error("connection closed")]
Closed,
/// Command channel is closed.
#[error("channel closed")]
ChannelClosed,
/// Stream frame exceeded the configured limit.
#[error("frame too large: current={current}, max={max}")]
FrameTooLarge { current: usize, max: usize },
/// Datagram payload exceeded the configured limit.
#[error("datagram too large: current={current}, max={max}")]
DatagramTooLarge { current: usize, max: usize },
/// Decoder returned an error.
#[error("decode error: {0}")]
Decode(String),
/// Encoder returned an error.
#[error("encode error: {0}")]
Encode(String),
/// Pipeline stage returned a framework-level error.
#[error("pipeline error: {0}")]
Pipeline(String),
/// TLS configuration or handshake failed.
#[error("tls error: {0}")]
Tls(String),
/// Datagram write required a default peer but none was available.
#[error("missing default peer for datagram write")]
MissingDatagramPeer,
}
/// Convenience result alias for rs-netty operations.
pub type Result<T> = std::result::Result<T, Error>;